<template>
  <!-- 发布工具  自动获取 -->
  <div class="release-tool-page">
    <!-- <el-button type="text" @click="lianxi">属性不全？点此联系管理员</el-button> -->
    <div>
      <div>
        <div class="sub-tit flex">
          <formSubTitVue :title="'商品详细信息'" />
            <div v-if="!retal" style="height: 100%;text-align: right;" @click="attributeChange(form.gameId)">
          <el-button type="text">缺少属性<i class="el-icon-question" size="22"></i></el-button>   
        </div>
        </div>
        <el-form ref="formRel" :model="form" :inline="true" :rules="rules" :label-width="'120px'" class="form-box demo-ruleForm new_form_box">
          <div class="step1 ">
            <!-- <el-form-item
              prop=""
              label="游戏名称："
            >
              <h2 style="width:100px">{{form.gameName}}</h2>
            </el-form-item><br/> -->
            <template v-if="!isView&&(form.isAutoImg==3||(isEdit&&!isBackGoods))">
              <div v-if="form.gameName == '王者荣耀'">
                <el-form-item label="营地获取" class="attr-input-content">
                  <div class="input-btn flex" style="padding-top: 0;">
                    <el-input :disabled="shopInfo && shopInfo.campNumber < 1" v-model="form.f17" color="#333" placeholder="请输入营地ID加载数据" style="flex-shrink: 0"></el-input>

                    <!-- <shengyu ref="shengyu" :num="1" /> -->
                  </div>
                </el-form-item>
                <el-button class="get_by_yingdi_btn" :disabled="shopInfo && shopInfo.campNumber < 1" type="primary" plain @click="getRoleList" :loading="btnLoading">一键获取</el-button>
                <!-- <br v-if="form.gameName == '王者荣耀' && !isView" /> -->
                <el-form-item prop="roleId" label="角色列表" class="attr-input-content">
                  <el-select :disabled="shopInfo && shopInfo.campNumber < 1" placeholder="输入营地ID加载数据" v-model="form.roleId" @change="roleSelect">
                    <el-option v-for="item2 in roleList" :key="item2.zdytext" :label="item2.zdytext" :value="item2.roleId"></el-option>
                  </el-select>
                </el-form-item>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>

              <!-- 王者荣耀个性化属性 end -->
              <!-- 和平精英个性化属性 start -->
              <div v-if="form.gameName == '和平精英'">
                <el-button class="get_by_yingdi_btn saoma" type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="getQRcode" :loading="btnLoading">扫码获取</el-button>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 和平精英个性化属性 end -->

              <!-- 无畏契约个性化属性 start -->
              <div v-if="form.gameName == '无畏契约'">
                <el-form-item label="快速获取" class="attr-input-content">
                  <el-input placeholder="请输入掌瓦号" v-model="zwId"></el-input>
                </el-form-item>
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="WWGetQrcode(2)" :loading="btnLoading">掌瓦号获取</el-button>
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="WWGetQrcode('')" :loading="btnLoading">扫码获取</el-button>

               <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 无畏契约个性化属性 end -->

              <!-- LOL个性化属性 start -->
              <div v-if="form.gameName == '英雄联盟'">
                <el-button type="primary" class="get_by_yingdi_btn saoma" :disabled="shopInfo && shopInfo.campNumber < 1" @click="lolGetQrcode('LOL')" :loading="btnLoading">扫码获取</el-button>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- LOL个性化属性 end -->

              <!-- LOL手游个性化属性 start -->
              <div v-if="form.gameId == '25'">
                <el-button type="primary" class="get_by_yingdi_btn saoma" :disabled="shopInfo && shopInfo.campNumber < 1" @click="lolGetQrcode('LOLM')" :loading="btnLoading">扫码获取</el-button>
               <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- LOL手游个性化属性 end -->

              <!-- CF个性化属性 start -->
              <div v-if="form.gameId == '6'">
                <el-button type="primary" class="get_by_yingdi_btn saoma" :disabled="shopInfo && shopInfo.campNumber < 1" @click="getQRcodeCF" :loading="btnLoading">扫码获取</el-button>
               <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- CF个性化属性 end -->

              <!-- 金铲铲个性化属性 start -->
              <div v-if="form.gameId == '16'">
                <el-button type="primary" class="get_by_yingdi_btn saoma" :disabled="shopInfo && shopInfo.campNumber < 1" @click="getQRcodeJCC" :loading="btnLoading">扫码获取</el-button>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 金铲铲个性化属性 end -->

              <!--火影忍者个性化属性 start -->
              <div v-if="form.gameId == '10'">
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="HYRZgetQrcode" :loading="btnLoading">扫码获取</el-button>

                <el-form-item label="角色列表" style="margin-left: 20px;">
                  <el-select clearable :disabled="shopInfo && shopInfo.campNumber < 1" v-model="selectedHYRZrole" @change="HYRZroleChange">
                    <el-option v-for="item2 in roleHYRZlist" :key="item2.Partition" :label="`${item2.Partition}区/${item2.Level}级/${item2.CharacName}`" :value="item2.Partition">

                    </el-option>
                  </el-select>
                </el-form-item>

               <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 火影忍者个性化属性 end -->

              <!--永劫无间 个性化属性 start -->
              <div style="margin-bottom: 10px;" v-if="form.gameId == '12'&&(form.serverId == 55615||form.serverId == 96543)">
                <!-- <el-form-item v-if="form.serverId == 55615" label="游戏账号" label-width="80px" class="attr-input-content">
                <div class="input-btn flex" style="padding-top: 0;">
                  <el-input :disabled="shopInfo && shopInfo.campNumber < 1" v-model="form.accountNumber" color="#333" placeholder="请输入邮箱账号"></el-input>
                </div>
              </el-form-item>
              <el-form-item v-if="form.serverId == 55615" label="密码" label-width="50px" class="attr-input-content">
                <div class="input-btn flex" style="padding-top: 0;">
                  <el-input :disabled="shopInfo && shopInfo.campNumber < 1" v-model="form.accountPassword" color="#333" placeholder="请输入游戏密码"></el-input>
                </div>
              </el-form-item>
              <el-form-item v-if="form.serverId == 96543" label="手机号" label-width="50px" class="attr-input-content">
                <div class="input-btn flex" style="padding-top: 0;">
                  <el-input :disabled="shopInfo && shopInfo.campNumber < 1" v-model="form.securityPhone" color="#333" placeholder="请输入游戏密码"></el-input>
                </div>
              </el-form-item> -->
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="openAccountYJWJ" :loading="btnLoading">获取数据</el-button>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3;cursor: pointer;' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 永劫无间 个性化属性 end -->

              <!--三角洲 个性化属性 start -->
              <div v-if="form.gameId == '67'&&(form.carrierId == 94175)">
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="SanJiaoZhougetQrcode" :loading="btnLoading">扫码获取</el-button>
                <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 三角洲 个性化属性 end -->
                <!--枪战王者 个性化属性 start -->
              <div v-if="form.gameId == 8">
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="QzwzGetQrcode" :loading="btnLoading">扫码获取</el-button>
               <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- 枪战王者 个性化属性 end -->

               <!--QQ飞车 个性化属性 start ||form.gameId == 14 -->
               <div v-if="form.gameId == 7">
                <el-button type="primary" :disabled="shopInfo && shopInfo.campNumber < 1" @click="QQspeedGetQrcode" :loading="btnLoading">扫码获取</el-button>
              <span style="color: #999;" v-if="shopInfo&&shopInfo.baseServer ==1">
                  1虞豆/次,<span style='color:#6c5dd3' @click='goLinkto'>开通基础服务包后免虞豆</span>
                </span>
                 <span style="color: #999;text-decoration: line-through;" v-else>
                  1虞豆/次
                </span>
              </div>
              <!-- QQ飞车 个性化属性 end -->

            </template>

            <!-- 简介 商品描述 -->
            <!-- ||(form.isAutoImg == 2&&(form.gameId == 11||form.gameId == 2||form.gameId == 3||form.gameId == 5||form.gameId == 6||form.gameId == 29||form.gameId == 10||form.gameId == 16||form.gameId == 25)) -->
            <el-form-item label-width="90px" class="row" label="商品描述" prop="des" v-if="form.isAutoImg != 2">
              <el-input v-model="form.des" type="textarea" placeholder="请按顺序编写简介信息内容，例如：王者荣耀 安卓Q 有二次 英雄数量 皮肤数量 皮肤简介..." :rows="5" :disabled="isView" />
              <div style="padding-bottom: 10px;padding-top: 10px;">
                <el-button type="primary" @click="zidongChange" plain  v-if="!isView">
                  自动识别
                </el-button>
                <el-button type="warning" @click="shengcheng" plain v-if="!isView">
                  生成描述
                </el-button>
                <!-- <span style="color: red;margin-left: 10px;font-size: 12px;line-height: 22px;width: 650px;">
                  自动识别仅能识别多选项，多个选择项请以","分割;为了提高准确性，请保证简介中的皮肤名称与本系统皮肤名称一致。
                </span> -->
              </div>
            </el-form-item>
          </div>
          <div class="step2 ">
            <!-- <el-form-item label="系统" prop="systemId" v-if="form.gameType == 0" key="systemId">
              <el-select v-model="form.systemId" filterable placeholder="请选择" @change="sysChange">
                <el-option v-for="dict in sysList" :key="dict.id" :label="dict.fieldName" :value="dict.id" />
              </el-select>
            </el-form-item>
            <el-form-item label="运营商" prop="carrierId" v-if="form.gameType == 0" key="carrierId">
              <el-select v-model="form.carrierId" filterable placeholder="请选择" @change="getAreaList">
                <el-option v-for="dict in carrierList" :key="dict.id" :label="dict.fieldName" :value="dict.id" />
              </el-select>
            </el-form-item>
            <el-form-item label="大区" prop="groupId">
              <el-select v-model="form.groupId" filterable placeholder="请选择" @change="getServiceList">
                <el-option v-for="dict in areaList" :key="dict.id" :label="dict.fieldName" :value="dict.id" />
              </el-select>
            </el-form-item>
            <el-form-item label="服务器" prop="serverId">
              <el-select v-model="form.serverId" filterable placeholder="请选择" @change="serverChange">
                <el-option v-for="dict in serverList" :key="dict.id" :label="dict.fieldName" :value="dict.id" />
              </el-select>
            </el-form-item> -->
            <!-- 渲染自定义字段 -->
            <div v-if="attrs && attrs.length">
              <span v-for="custom in attrs" :key="custom.id">
                <div v-if="
                    custom.fieldType == 'checkbox' ||
                    custom.fieldType == 'boxradio'
                  "></div>
                <el-form-item :label="custom.fieldName" :prop="custom.aavName" v-if="isShowAttr(custom)">
                  <el-input v-model="form[custom.aavName]" :placeholder="`请填写${custom.fieldName}`" v-if="custom.fieldType == 'input'" :disabled="isView" />
                  <el-input @change="numChange($event,custom.aavName)" v-model="form[custom.aavName]" maxlength="8" :placeholder="`请填写${custom.fieldName}`" v-if="custom.fieldType == 'number'" :disabled="isView"></el-input>
                  <el-date-picker v-model="form[custom.aavName]" type="datetime" :placeholder="`请选择${custom.fieldName}`" value-format="yyyy-MM-dd hh:mm:ss" v-if="custom.fieldType == 'date'" :disabled="isView">
                  </el-date-picker>
                  <el-checkbox-group v-model="form[custom.aavName + 'rander']" v-if="custom.fieldType == 'checkbox'&&custom.zhankai" @change="checkboxChange($event, custom.aavName)">
                    <template v-for="checkItem in custom.childAttributes">
                      <el-checkbox :label="checkItem.id" v-if="checkItem.isshow==1" :value="checkItem.id" :key="checkItem.id" :disabled="isView">{{ checkItem.fieldName }}</el-checkbox>
                    </template>
                  </el-checkbox-group>
                  <el-checkbox-group v-model="form[custom.aavName + 'rander']" v-if="custom.fieldType == 'checkbox'&&!custom.zhankai&&custom.childAttributes&&custom.childAttributes.length" @change="checkboxChange($event, custom.aavName)">
                    <template v-for="checkItem in custom.childAttributes.slice(0,9)">
                      <el-checkbox :label="checkItem.id" v-if="checkItem.isshow==1" :value="checkItem.id" :key="checkItem.id" :disabled="isView">{{ checkItem.fieldName }}</el-checkbox>
                    </template>
                  </el-checkbox-group>
                  <div style="text-align: center;font-size: 18px;color: dodgerblue;" v-if="custom.fieldType == 'checkbox'&&custom.childAttributes&&custom.childAttributes.length>9">
                    <i @click="zhankaiFn(custom)" :style="`transform:${custom.zhankai?'rotate(-90deg)':'rotate(90deg)'} ;cursor: pointer;`" class="el-icon-d-arrow-right"></i>
                  </div>
                  <el-select v-model="form[custom.aavName]" filterable placeholder="请选择" v-if="custom.fieldType == 'radio'" :disabled="isView" @change="radioChange($event, custom.aavName, custom.childAttributes)">
                    <el-option v-for="item in custom.childAttributes" :key="item.id" :label="item.fieldName" :value="item.id">
                    </el-option>
                  </el-select>
                  <div v-if="custom.fieldType == 'boxradio'">
                    <el-checkbox v-for="(checkItem, i) in custom.childAttributes" :key="checkItem.id" :value="checkItem.ischeck" @change="boxradioCheckClick($event, custom, checkItem, i)">
                      {{ checkItem.fieldName }}
                      <el-radio-group class="boxradioRadioBox" :class="{ show: checkItem.id == boxradioIsShow }" v-model="form[custom.aavName + i]" @change="boxradioChange($event, checkItem, custom, i)">
                        <el-radio v-for="item2 in checkItem.childAttributes" :key="item2.id" :label="item2.id">{{ item2.fieldName }}</el-radio>
                      </el-radio-group>
                    </el-checkbox>
                  </div>
                </el-form-item>
                <div v-if="
                    custom.fieldType == 'boxradio'
                  "></div>

              </span>
            </div>
          </div>
        </el-form>
      </div>
    </div>
  
    <!-- 各游戏的营地授权二维码 -->
    <lolAuth ref="lolAuth" @success="getLOLinfo"></lolAuth>
    <!-- <cfAuth ref="cfAuth" @success="getCFinfo"></cfAuth> -->
    <JCCAuth ref="JCCAuth" @success="getJCCinfo"></JCCAuth>
    <wwAuth ref="WWAuth" @success="getLwwinfo"></wwAuth>
    <HuoYingRenzhe ref="HuoYingRenzhe" @success="getHYRZRoleList"></HuoYingRenzhe>
    <SanJiaoZhou ref="SanJiaoZhou" @success="getSanJiaoZhouqqData"></SanJiaoZhou>
    <QiangzhanWangzhe ref="QiangzhanWangzhe" @success="getQiangzhanWangzheData"></QiangzhanWangzhe>
    <QQspeed ref="QQspeed" @success="getQQspeedData"></QQspeed>
    <HPJY ref="HPJY" @success="showHpCheckbox"></HPJY>


    <lianxi ref="lianxi"></lianxi>

    <chongzhi ref="chongzhi"></chongzhi>

     <attribute ref="attributeRef"></attribute>
  </div>
</template>

<script>
import gameConfigApi from "../../../api/gameConfig";
import gameDictionaryApi from "../../../api/gameConfig/gameDictionary";
import infoApi from "@/api/autoProduction/information.js";
import makeImgsV3 from "@/utils/makeImgs-v3";
import shengyu from "@/components/yudu/shengyu.vue";
import { getToken } from "@/utils/auth";
import lolAuth from "../../../components/getGameInfo/LOL.vue";
// import cfAuth from "../../../components/getGameInfo/CF.vue";
import JCCAuth from "../../../components/getGameInfo/JCC.vue";
import wwAuth from "../../../components/getGameInfo/Ww.vue";
import HuoYingRenzhe from "../../../components/getGameInfo/HuoYingRenzhe.vue";
import SanJiaoZhou from "../../../components/getGameInfo/SanJiaoZhou.vue";
import QiangzhanWangzhe from "../../../components/getGameInfo/QiangzhanWangzhe.vue";
import QQspeed from "../../../components/getGameInfo/QQspeed.vue";
import HPJY from "../../../components/getGameInfo/HPJY.vue";

import lianxi from "@/components/tenant/lianxi.vue";
// import Lianxiwomen from "@/components/ConsignmentFourzero/lianxiwomen.vue";
import formSubTitVue from "@/views/tenantPages/components/formSubTit.vue";
// import qiangzhandata from "./qiangzhandata";


// import feicheData from "./feiche";
import feicheData from "./feichem";

import chongzhi from "@/views/tenantPages/moneys/components/chongzhijifen.vue";

import attribute from "@/layout/components/components/attribute.vue";

export default {
  name: "addGoods",
  components: {
    lolAuth,
    // cfAuth,
    wwAuth,
    lianxi,
    shengyu,
    formSubTitVue,
    JCCAuth,
    chongzhi,
    HuoYingRenzhe,
    SanJiaoZhou,
    QiangzhanWangzhe,
    QQspeed,
    HPJY,
    attribute
  },
  props: {
    formData: {
      type: Object,
      default: {},
    },
    type: {
      type: String,
      default: "",
    },
    isEdit: {
      type: Boolean,
      default: false,
    },
     retal: {
      type: Boolean,
      default: false,
    },
    isView: {
      type: Boolean,
      default: false,
    },
    isBackGoods: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    // gameItem: {
    //   handler(newVal) {
    //     ////console.log("%c Line:662 🥚gameItem newVal", "color:#e41a6a", newVal);
    //     // this.form.gameId = newVal.id;
    //     // this.form.gameType = newVal.type;
    //     // this.form.gameName = newVal.name;
    //     // if (newVal && newVal.id) {
    //     //   this.init();
    //     // }else{}
    //   },
    //   deep: true,
    //   immediate: true,
    // },
    formData: {
      handler(newVal, oldVal) {
        if ((oldVal && oldVal.gameId != newVal.gameId) || newVal.reset) {
          newVal.des = newVal.des || "";
          this.zwId = "";
          const temp = JSON.parse(JSON.stringify(newVal));
          this.form = {
            // groupId: "",
            // serverId: "",
            // systemId: "",
            // carrierId: "",
            isAutoImg: "",
            f1: "",
            f2: "",
            f3: "",
            f4: "",
            f5: "",
            f6: "",
            f7: "",
            f8: "",
            f9: "",
            f10: "",
            f11: "",
            f12: "",
            f13: "",
            f14: "",
            f15: "",
            f16: "",
            f17: "",
            f18: "",
            f19: "",
            f20: "",
            f21: "",
            f22: "",
            f23: "",
            f24: "",
            f25: "",
            f26: "",
            f27: "",
            f28: "",
            f29: "",
            f30: "",
            f31: "",
            f32: "",
            f33: "",
            f34: "",
            f35: "",
            f36: "",
            f37: "",
            f38: "",
            f39: "",
            f40: "",
          };
          this.form = { ...this.form, ...temp };

          if (this.form && this.form.gameId) {
            this.attrs = [];
            this.init();
          }
        }
      },
      deep: true,
      immediate: true,
    },
  },
  data() {
    return {
      HYRZcookie: "",
      roleHYRZlist: [],
      selectedHYRZrole: "",

      Times: null,
      pushAllList: [],
      pushGroupList: [],
      pushGroup: "", //选择的渠道分组
      checkboxGroup1: [],

      qufuSelect: [],
      qufuList: [],

      dialogVisible: false,
      btnLoading: false,
      makeTitleImgBtnLoading: false,
      makeDetailImgBtnLoading: false,
      loading: false,
      roleVisible: false,
      poxiaoHpQrcode: "",
      actived: "",
      activedIndex: 0,
      roleList: [], //王者荣耀角色列表
      mingziList: [], //和平角色列表
      hpLoading: false,
      gameList: [],
      // 表单参数
      form: {
        // groupId: "",
        // serverId: "",
        // systemId: "",
        // carrierId: "",
        isAutoImg: "",
        f1: "",
        f2: "",
        f3: "",
        f4: "",
        f5: "",
        f6: "",
        f7: "",
        f8: "",
        f9: "",
        f10: "",
        f11: "",
        f12: "",
        f13: "",
        f14: "",
        f15: "",
        f16: "",
        f17: "",
        f18: "",
        f19: "",
        f20: "",
        f21: "",
        f22: "",
        f23: "",
        f24: "",
        f25: "",
        f26: "",
        f27: "",
        f28: "",
        f29: "",
        f30: "",
        f31: "",
        f32: "",
        f33: "",
        f34: "",
        f35: "",
        f36: "",
        f37: "",
        f38: "",
        f39: "",
        f40: "",
      },
      selectedPhone: "",
      sysList: [], //系统列表
      carrierList: [], //运营商列表
      areaList: [], //大区列表
      serverList: [], //服务器列表

      imgFileList: [],
      imgShowList: [],
      titleImgList: [],
      videoList: [],
      ifSpecial: false,
      uploadImgUrl: "",
      uploadVideoUrl: "",
      headers: {},
      customAttr: null,
      newImages: [], //编辑的时候新增加的图片，新增的时候新增加的图片
      attrs: [],
      boxradioIsShow: "",
      rules: {
        // systemId: [
        //   { required: true, message: "请选择系统", trigger: "change" },
        // ],
        // carrierId: [
        //   { required: true, message: "请选择运营商", trigger: "change" },
        // ],
        // groupId: [{ required: true, message: "请选择大区", trigger: "change" }],
        // serverId: [
        //   { required: true, message: "请选择服务器", trigger: "change" },
        // ],
        des: [{ required: true, message: "请输入简介", trigger: "change" }],
      },
      zwId: "",
      loadingFull: null, //全屏的加载动画

      HPloginData: "",
      timeOutTimer: null,
      checkPending: false,
    };
  },
  created() {
    this.headers = {
      Authorization: "Bearer " + getToken(),
    };
    this.uploadImgUrl = process.env.VUE_APP_BASE_API + "/upload/image";
    this.uploadVideoUrl = process.env.VUE_APP_BASE_API + "/upload/video";
  },
  computed: {
    isShowAttr() {
      // 判读是否显示该自定义字段
      return (custom) => {
        let r = false;
        if (this.form.id) {
          r = true;
        } else {
          r = false;
          if (this.form.gameId != 10 && this.form.gameId != 12) {
            // 可以勾选自动截图的游戏id
            r = true;
          }
          if (this.form.isAutoImg != 2) {
            // 没勾选自动截图
            r = true;
          } else {
            // 勾选了自动截图
            r = false;
            // if(this.form.gameId == 2||this.form.gameId == 3||this.form.gameId == 5||this.form.gameId == 6||this.form.gameId == 29||this.form.gameId == 10||this.form.gameId == 16||this.form.gameId == 25){
            //   // 王者  和平 LOL CF 枪战王者 无畏契约 金铲铲 LOL手游  扫码授权，字段全部展示
            //   r = true;
            // }
            if (
              this.form.gameId == 2 &&
              (custom.aavName == "f4" ||
                custom.aavName == "f16" ||
                custom.aavName == "f17" ||
                custom.aavName == "f18" ||
                custom.aavName == "f27")
            ) {
              r = true;
            }
            if (
              this.form.gameId == 10 &&
              (custom.aavName == "f9" || custom.aavName == "f7")
            ) {
              r = true;
            }
            if (this.form.gameId == 12 && custom.fieldType != "checkbox") {
              r = true;
            }
            if (this.form.gameId == 37 && custom.aavName == "f22") {
              r = true;
            }
            if (this.form.gameId == 34 && custom.aavName == "f1") {
              r = true;
            }
            if (
              this.form.gameId == 21 &&
              (custom.aavName == "f2" ||
                custom.aavName == "f3" ||
                custom.aavName == "f4" ||
                custom.aavName == "f5" ||
                custom.aavName == "f6")
            ) {
              r = true;
            }
            if (
              this.form.gameId == 8 &&
              (custom.aavName == "f9" ||
                custom.aavName == "f4" ||
                custom.aavName == "f6" ||
                custom.aavName == "f10" ||
                custom.aavName == "f15" ||
                custom.aavName == "f16" ||
                custom.aavName == "f17" ||
                custom.aavName == "f13" ||
                custom.aavName == "f12")
            ) {
              r = true;
            }
            if (this.form.gameId == 19 && custom.aavName == "f3") {
              r = true;
            }
            if (
              this.form.gameId == 4 &&
              (custom.aavName == "f6" ||
                custom.aavName == "f2" ||
                custom.aavName == "f1")
            ) {
              r = true;
            }
            if (
              this.form.gameId == 14 &&
              (custom.aavName == "f1" || custom.aavName == "f2")
            ) {
              r = true;
            }
            if (this.form.gameId == 67 && custom.aavName == "f8") {
              r = true;
            }
            if (this.form.gameId == 11) {
              r = true;
            }
            const showArr73 = ['f1','f2','f9','f46','f10','f12','f29','f30','f31','f32','f11','f45']
            if (
              this.form.gameId == 73 && showArr73.includes(custom.aavName)
            ) {
              r = true;
            }
          }
        }
        return r;
      };
    },
    shopInfo() {
      return this.$store.getters.shopInfo;
    },
  },
  methods: {
     attributeChange(gameId) {
      this.$refs.attributeRef.open(gameId)
    },
    // 营地获取  开始
    yingdiNext(yingdi) {
      // console.log("%c Line:597 🍒 yingdi", "color:#ea7e5c", yingdi);
      if (this.form.gameId == 12) {
        // 永劫无间
        if (yingdi) {
          if (this.form.serverId == 55615) {
            // 账号密码获取
            this.form.accountPassword = yingdi.accountPassword;
            this.form.accountNumber = yingdi.accountNumber;
            // 开始获取
            this.getAccountInfoYJWJ();
          }
          if (this.form.serverId == 96543) {
            // yingdi
            // console.log("%c Line:658 🍡 yingdi", "color:#fca650", yingdi);
            this.AccountInfoYJWJformat(yingdi);
          }
        }
      }
      if (this.form.gameId == 2) {
        if (yingdi) {
          this.form.f17 = yingdi;
          // 开始获取
          this.getRoleList();
        }
      }
      if (this.form.gameId == 3) {
        this.getQRcode();
      }
      if (this.form.gameId == 29) {
        // 无畏契约
        if (yingdi) {
          this.zwId = yingdi;
          this.WWGetQrcode(2);
        } else {
          this.WWGetQrcode("");
        }
      }
      if (this.form.gameId == 5) {
        this.lolGetQrcode("LOL");
      }
      if (this.form.gameId == 25) {
        this.lolGetQrcode("LOLM");
      }
      
      if (this.form.gameId == 16) {
        this.getQRcodeJCC();
      }
      // 火影忍者
      if (this.form.gameId == 10) {
        this.HYRZgetQrcode();
      }
      // 三角洲
      if (this.form.gameId == 67) {
        this.SanJiaoZhougetQrcode();
      }
      if (this.form.gameId == 6) {
        // 穿越火线
        this.getQRcodeCF();
      }
      // 枪战王者
      if (this.form.gameId == 8) {
        this.QzwzGetQrcode();
      }
      // QQ飞车
      if (this.form.gameId == 7||this.form.gameId == 14) {
        this.QQspeedGetQrcode();
      }
    },
    // 展开
    zhankaiFn(custom) {
      // console.log("%c Line:914 🥪 custom", "color:#b03734", custom);
      if (custom.zhankai) {
        custom.zhankai = false;
      } else {
        custom.zhankai = true;
      }
      this.$forceUpdate();
    },
    // 区服改变
    updateQufu(data) {
      this.form.systemId = data.systemId;
      this.form.systemName = data.systemName;
      this.form.carrierId = data.carrierId;
      this.form.carrierName = data.carrierName;
      this.form.groupId = data.groupId;
      this.form.groupName = data.groupName;
      this.form.serverId = data.serverId;
      this.form.serverName = data.serverName;
    },
    // 勾选自动截图  查询虞豆是否充足
    isAutoChange(e) {
      if (e == 2) {
        infoApi
          .autoImgCost({
            gameName: this.form.gameName,
            systemName: this.form.systemName,
            carrierName: this.form.carrierName,
            groupName: this.form.groupName,
          })
          .then((res) => {
            // console.log("%c Line:442 🥓 res", "color:#93c0a4", res);
            if (res.code == 10000) {
              this.form.isAutoImg = 1;
              this.$refs.chongzhi.open();
            }
          });
      }
    },
    // 联系管理员
    lianxi() {
      this.$refs.lianxi.open();
    },
    // 初始化页面
    // tabs切换时触发
    init() {
      console.log("%c Line:566 🍒 init", "color:#ea7e5c",'itnitnit');
      // if (this.form.gameType == 1) {
      //   // 端游
      //   if(!this.form.groupId){
      //     this.getAreaList("", true, this.form.groupId);
      //   }
      // } else {
      //   if(!this.form.systemId){
      //     this.getSysList();
      //     this.getYysList();
      //   }
      // }

      this.selectDialogGameType();
    },
    // 返回页面
    back() {
      this.close();
      this.$emit("back");
    },
    // 编辑时回显
    editView(formData) {
      ////console.log("%c Line:538 🍋 formData", "color:#93c0a4", formData);
      this.getAttrList();
    },
    // 校验规则重置
    resetRules() {
      this.rules = {
        systemId: [
          { required: true, message: "请选择系统", trigger: "change" },
        ],
        carrierId: [
          { required: true, message: "请选择运营商", trigger: "change" },
        ],
        groupId: [{ required: true, message: "请选择大区", trigger: "change" }],
        serverId: [
          { required: true, message: "请选择服务器", trigger: "change" },
        ],
        des: [{ required: true, message: "请输入简介", trigger: "change" }],
      };
    },

    // 简介自动生成
    desAutoset() {
      if (this.form.gameId == 2) {
        // 处理简介
        let str = "";
        let guizu = "";
        let duanwei = "";
        this.attrs.forEach((item) => {
          if (item.aavName == "f2") {
            // 处理贵族等级
            item.childAttributes.forEach((t2) => {
              if (this.form.f2 == t2.id) {
                guizu = t2.fieldName;
              }
            });
          }
          if (item.aavName == "f3") {
            // 处理段位
            item.childAttributes.forEach((t2) => {
              if (this.form.f3 == t2.id) {
                duanwei = t2.fieldName;
              }
            });
          }
          if (
            item.fieldType == "checkbox" &&
            item.isEnable == 0 &&
            item.childAttributes &&
            item.childAttributes.length &&
            this.form[item.aavName + "rander"] &&
            this.form[item.aavName + "rander"].length
          ) {
            let times = 0;
            item.childAttributes.forEach((t2) => {
              // data.listJson
              this.form[item.aavName + "rander"].forEach((t3) => {
                if (t3 && t2.id == t3) {
                  // 拼接简介
                  if (times === 0) {
                    str =
                      str +
                      "\n【" +
                      this.form[item.aavName + "rander"].length +
                      " " +
                      item.fieldName +
                      "】";
                  }
                  times++;
                  str = str + t2.fieldName + ",";
                }
              });
            });
          }
        });
        let str2 = `${this.form.systemName || ""}${
          this.form.carrierName || ""
        }${guizu ? "/" + guizu : ""}${duanwei ? "/" + duanwei : ""}/${
          this.form.f8 || "--"
        }皮肤/${this.form.f7 || "--"}英雄/${
          this.form.f9rander && this.form.f9rander.length
            ? this.form.f9rander.length
            : 0
        }典藏/${
          this.form.f39rander && this.form.f39rander.length
            ? this.form.f39rander.length
            : 0
        }珍品无双/${
          this.form.f21rander && this.form.f21rander.length
            ? this.form.f21rander.length
            : 0
        }无双/${
          this.form.f36rander && this.form.f36rander.length
            ? this.form.f36rander.length
            : 0
        }珍品传说/${
          this.form.f12rander && this.form.f12rander.length
            ? this.form.f12rander.length
            : 0
        }传说/${
          this.form.f11rander && this.form.f11rander.length
            ? this.form.f11rander.length
            : 0
        }史诗/${
          this.form.f5rander && this.form.f5rander.length
            ? this.form.f5rander.length
            : 0
        }稀有英雄`;
        
        this.$set(
          this.form,
          "des",
          str2 + str + `\n营地ID:${this.form.f17 || ""} `
        );
        // 设置标题
        this.$emit("setTitle", this.form.des);
      }
      // else{
      //   this.shengcheng()
      // }
    },

    // 开启loading
    loadingStart() {
      this.loadingFull = this.$loading({
        lock: true,
        text: "数据获取中,请耐心等待...",
        spinner: "el-icon-loading",
        color: "#fff",
        background: "rgba(0, 0, 0, 0.7)",
      });
    },
    loadingEnd() {
      if (this.loadingFull) {
        this.loadingFull.close();
        this.loadingFull = null;
      }
    },

    /**
     *
     *  王者荣耀个性化营地获取 start
     */

    //获取角色列表 f17是营地ID
    getRoleList() {
      if (this.form.f17) {
        this.btnLoading = true;
        this.loadingStart();
        infoApi
          .getRoleList({
            campId: this.form.f17,
          })
          .then((res) => {
            this.btnLoading = false;
            this.loadingEnd();
            if (res.data) {
              this.roleList = res.data;
              if (this.roleList.length) {
                //遍历添加展示数据
                this.roleList.forEach((item) => {
                  item.zdytext = `${item.areaName}/${item.roleJob}/${item.roleName}`;
                });
                // this.formData.roleValue = this.roleList[0].zdytext;
                this.form.roleId = this.roleList[0].roleId;
                this.getRoleInfo(this.roleList[0].roleId);
              } else {
                this.$message.error("没有获取到信息！请检查营地号！");
              }
            }
          })
          .catch((err) => {
            this.loadingEnd();
            this.btnLoading = false;
          });
      } else {
        this.$alert("请先填写营地ID！");
      }
    },
    //角色选中
    roleSelect(e) {
      this.getRoleInfo(e);
    },
    //王者荣耀 获取角色详情
    getRoleInfo(roleId) {
      if (roleId) {
        this.btnLoading = true;
        this.loadingStart();
        infoApi
          .getRoleInfo({
            campId: this.form.f17,
            roleId: roleId,
          })
          .then((res) => {
            this.loadingEnd();
            this.btnLoading = false;
            this.$store.dispatch("getShopInfo");
            this.showCheckbox(res);
          })
          .catch((err) => {
            this.loadingEnd();
            this.btnLoading = false;
            ////console.log("%c Line:786 🥟 err", "color:#f5ce50", err.Error);
            this.$alert(err);
          });
      } else {
        this.$alert("请先选择角色信息！");
      }
    },
    //  回显  拼装简介
    async showCheckbox(res) {
      ////console.log("%c Line:436 🌰 res", "color:#e41a6a", res);
      ////console.log("%c Line:436 🌰 res", "color:#e41a6a", res);
      let data = res.data;
      // this.$set(this.form, "systemId", data.skinMap.systemId);
      // this.$set(this.form, "carrierId", data.skinMap.carrierId);
      // this.$set(this.form, "groupId", data.skinMap.groupId);
      // this.$set(this.form, "serverId", data.skinMap.serverId);

      this.$set(this.form, "f25", data.skinMap.rongyaoCount);
      this.$set(this.form, "f8", data.skinMap.skinNum);
      this.$set(this.form, "f7", data.skinMap.heroNum);
      this.$set(this.form, "f1", data.skinMap.level);
      // this.$set(this.form, "f3", data.skinMap.jobId);
      // this.zidongChange()
      // if (data.skinMap.carrierId && data.skinMap.groupId) {
      //   try {
      //     this.getAreaList(data.skinMap.carrierId, true, data.skinMap.groupId);
      //   } catch (error) {}
      // }
      // if (this.sysList && this.sysList.length) {
      //   this.sysList.forEach((r) => {
      //     if (r.id == this.form.systemId) {
      //       this.form.systemName = r.fieldName;
      //     }
      //   });
      // }
      // if (this.carrierList && this.carrierList.length) {
      //   this.carrierList.forEach((r) => {
      //     if (r.id == this.form.carrierId) {
      //       this.form.carrierName = r.fieldName;
      //     }
      //   });
      // }
      // 回显勾选
      this.attrs.forEach((item) => {
        // if (item.aavName == "f2") {
        //   // 处理贵族等级
        //   item.childAttributes.forEach((t2) => {
        //     if (
        //       t2.fieldName.indexOf(data.skinMap.vipLevel) > -1 &&
        //       data.skinMap.vipLevel != 0 &&
        //       data.skinMap.vipLevel != 1
        //     ) {
        //       this.$set(this.form, "f2", t2.id);
        //     }
        //   });
        // }
        if (item.aavName == "f3") {
          // 处理段位
          item.childAttributes.forEach((t2) => {
            if (data.skinMap.jobName.includes(t2.fieldName)) {
              this.$set(this.form, "f3", t2.id);
            }
          });
        }
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == 0 &&
          item.childAttributes &&
          item.childAttributes.length
        ) {
          let times = 0;
          this.form[item.aavName + "rander"] = [];
          item.childAttributes.forEach((t2) => {
            // data.listJson
            data.listJson.forEach((t3) => {
              if (
                t3 &&
                t2.sid &&
                t3.skinId &&
                t2.sid == t3.skinId
                // (t2.fieldName == t3.szTitle + " " + t3.szHeroTitle ||
                //   t2.fieldName == t3.szTitle)
              ) {
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
              }
            });
          });
          if (this.form["f9rander"] && this.form["f9rander"].length) {
            this.form["f6"] = this.form["f9rander"].length;
          } else {
            this.form["f6"] = 0;
          }
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          this.$forceUpdate();
        }
      });
      let diancang = this.form["f9rander"].length;
      let wushuang = this.form["f21rander"].length;
      let chuanshuo = this.form["f12rander"].length;

      let zpcs = this.form["f36rander"].length;
      let zpws = this.form["f39rander"].length;

      this.$set(this.form, "f35", wushuang || 0);
      this.$set(this.form, "f23", chuanshuo || 0);
      this.$set(this.form, "f6", diancang || 0);
      // 珍品无双  珍品传说
      this.$set(this.form, "f41", zpws || 0);
      this.$set(this.form, "f40", zpcs || 0);

      this.desAutoset();

      this.$refs["formRel"].validate((valid) => {});

      // 自动生成主图和详情图
    },
    /**
     *
     *  王者荣耀个性化营地获取 end
     */
    /**
     *
     *  和平精英个性化营地获取 start
     */
    async getQRcode() {
      if (!this.form.carrierId) {
        this.$alert("请先选择运营商！");
        return;
      }
     
      // this.showHpCheckbox(data)
      this.$refs.HPJY.open(this.form.carrierId)
    },
    // 和平精英 匹配数据
    showHpCheckbox(res) {
      let data = JSON.parse(JSON.stringify(res));
      this.form.f13 = data.userId;
      this.form.f16 = data.wangpaiLevel;
      this.form.f18 = data.rlizhi;
      this.form.f19 = data.jswpTimes;
      // // 时装数
      this.form.f26 = data.szCount||0
      // 套装数
      this.form.f8 = data.tzCount||0

      // 特效枪
      let texiaoqiang = 0
      // 粉装数量
      let fenzhuang = 0
      // 红装数量
      let hongzhuang = 0
      // 战备数量
      let zhanbei = 0
      // 粉装简介
      let fenzhuangStr = "";
      // 红装简介
      let hongzhuangStr = "";
      // 特效枪简介
      let txqStr = "";
      // 获取需要的数据
      if(data.depotJson){
        this.form.f7 = data.depotJson.carSkinList?data.depotJson.carSkinList.length:0;
        this.form.f9 = data.depotJson.genSkinList?data.depotJson.genSkinList.length:0;
        // 特效枪
        if(data.depotJson.genSkinList&&data.depotJson.genSkinList.length){
          data.depotJson.genSkinList.forEach(qiang=>{
            if(qiang.quality==6){
              texiaoqiang++
              txqStr = `${txqStr?txqStr+',':''}${qiang.itemName}${qiang.level ? "/" + qiang.level + "级" : ""}`
            }
          })
        }
        // 特效枪
        this.form.f12 = texiaoqiang;
        // this.form.f27 = texiaoqiang;
        // 套装数量
        // 粉装数量
        // 红装数量
        if(data.depotJson.roleSkinList&&data.depotJson.roleSkinList.length){
          data.depotJson.roleSkinList.forEach(tz=>{
            if(tz.quality==6){
              // 粉装
              fenzhuang++
              fenzhuangStr = `${fenzhuangStr?fenzhuangStr+',':''}${tz.itemName}${tz.level ? "/" + tz.level + "级" : ""}`
            }
            if(tz.quality==7){
              // 红装
              hongzhuang++
              hongzhuangStr = `${hongzhuangStr?hongzhuangStr+',':''}${tz.itemName}${tz.level ? "/" + tz.level + "级" : ""}`
            }
          })
        }
        this.form.f11 = fenzhuang;
        this.form.f25 = hongzhuang;
        // 战备数量
        if(data.depotJson.materialSkinListFei&&data.depotJson.materialSkinListFei.length){
          zhanbei +=data.depotJson.materialSkinListFei.length 
        }
        if(data.depotJson.materialSkinListSan&&data.depotJson.materialSkinListSan.length){
          zhanbei +=data.depotJson.materialSkinListSan.length 
        }
        // materialSkinListji
        if(data.depotJson.materialSkinListji&&data.depotJson.materialSkinListji.length){
          zhanbei +=data.depotJson.materialSkinListji.length 
        }
        this.form.f28 = zhanbei;
      }

      if (data.highestDivTimes == 0) {
        this.form.f14 = 41777;
      } else if (data.highestDivTimes != 0) {
        this.form.f14 = 41776;
      }

      //获取段位
      const duanweobj = this.attrs.filter((item) => item.aavName === "f15");
      ////console.log(duanweobj);
      const hpduanw = duanweobj[0].childAttributes.filter((item) =>
        data.roleJob.includes(item.fieldName)
      );
      ////console.log(hpduanw);
      this.form.f15 = hpduanw[0].id;
      // 组装简介前半段
      let str2 = `${data.serverName}${data.areaName}-${
        data.wangpaiLevel
      }王牌印记${this.form.f14 == 41776 ? "-有战神框" : ""}${hongzhuang>0?'-'+hongzhuang+'红装':''}${fenzhuang>0?'-'+fenzhuang+'粉装':''}${texiaoqiang>0?'-'+texiaoqiang+'特效枪':''}${this.form.f7>0?'-'+this.form.f7+'载具':''}-${data.rlizhi||0}热力值-${this.form.f8||0}套装-${this.form.f9||0}枪皮${data.zywpTimes&&data.zywpTimes>0?'-'+data.zywpTimes+'卓越印记':''}${data.cqwpTimes&&data.cqwpTimes>0?'-'+data.cqwpTimes+'传奇印记':''}\n`;
      
      let otherStr = "";
      // this.form.des = data.des;

      // 回显勾选
      let listJson = []
      if(data.depotJson){
        listJson = [
          ...data.depotJson.carSkinList||[],
          ...data.depotJson.equipListBei||[],
          ...data.depotJson.materialSkinListSan||[],
          ...data.depotJson.genSkinList||[],
          ...data.depotJson.equipListTou||[],
          ...data.depotJson.roleSkinList||[],
          ...data.depotJson.materialSkinListFei||[],
          ...data.depotJson.materialSkinListJi||[]
        ];
      }
      
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.childAttributes &&
          item.childAttributes.length
        ) {
          this.form[item.aavName + "rander"] = [];
          let str3 = "";

          item.childAttributes.forEach((t2, i2) => {
            // data.listJson
            listJson.forEach((t3) => {
              if (t2.sid == t3.itemId) {
                // console.log("%c Line:810 🍉 t3.quality", "color:#ffdd4d", t3.quality);
                this.attrs[i1].childAttributes[i2].kz1 = t3.quality || "";
                if (t3.level) {
                  this.attrs[i1].childAttributes[i2].kz2 = t3.level || "";
                }
                this.form[item.aavName + "rander"].push(t2.id);
                str3 = `${str3?str3+',':''}${t2.fieldName}${t3.level ? "/" + t3.level + "级" : ""}`
              }
            });
          });
          str3 =
            this.form[item.aavName + "rander"].length > 0
              ? `【${this.form[item.aavName + "rander"].length}${
                  item.fieldName
                }】${str3}`
              : "";
          if (str3) otherStr = `${otherStr + "\n" + str3}`;

          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          this.$forceUpdate();
          this.$emit("attrChange", this.attrs);
        }
      });
      if (hongzhuangStr) {
        hongzhuangStr = `【${hongzhuang}红装】${hongzhuangStr}\n`;
      }
      if (fenzhuangStr) {
        fenzhuangStr = `【${fenzhuang}粉装】${fenzhuangStr}\n`;
      }
      
      if (txqStr) {
        txqStr = `【${texiaoqiang}特效枪】${txqStr}`;
      }
      this.form.des = str2 +hongzhuangStr+ fenzhuangStr + txqStr + otherStr;
      // 设置标题
      this.$emit(
        "setTitle",
        this.form.des
      );

    },
    /**
     *
     *  和平精英个性化营地获取 end
     */

    /**
     *
     * 永劫无间 自动获取皮肤数据 账号密码获取  开始
     *
     */
    openAccountYJWJ() {
      this.$emit("openZhongjianDialog");
    },
    async getAccountInfoYJWJ() {
      // 永劫无间
      if (!this.form.accountNumber) {
        this.$emit("getAccountInfoEnd", 2);
        return this.$message.error("请输入游戏账号！");
      }
      if (!this.form.accountPassword) {
        this.$emit("getAccountInfoEnd", 2);
        return this.$message.error("请输入游戏密码！");
      }

      this.btnLoading = true;
      // 邮箱账号  传账号密码进行获取
      try {
        //开始获取
        const res = await infoApi.ziYanGetYJWJ({
          account: this.form.accountNumber,
          password: this.form.accountPassword,
        });
        if (res.code == 200 && res.msg) {
          this.AccountInfoYJWJformat(res.msg);
        }
        this.$emit("getAccountInfoEnd", 1);
      } catch (error) {
        this.$emit("getAccountInfoEnd", 2);
      }

      this.btnLoading = false;
    },
    // 处理永劫无间获取到的数据
    AccountInfoYJWJformat(data) {
      const dataObj = data ? JSON.parse(data) : null;
      console.log("%c Line:1376 🥑 dataObj", "color:#33a5ff", dataObj);

      const resultArr = [];
      let str = "";
      if (dataObj) {
        if (dataObj.code == 200) {
          // 处理简介
          if (this.form.serverId == "96543") {
            // 手机账号
            this.form.f1 = 55649;
            str = str + "手机账号/ ";
          }
          if (this.form.serverId == "55615") {
            // 邮箱账号
            this.form.f1 = 55650;
            str = str + "邮箱账号/ ";
          }
          if (dataObj.userdata && dataObj.userdata.length) {
            // 角色信息
            for (let i = 0; i < dataObj.userdata.length; i++) {
              const role = dataObj.userdata[i];
              if (role.game == "永劫无间") {
                this.form.f48 = role.roleLevelStr;
                this.form.f49 = role.level;
                str = str + `${this.form.f48}/ 等级: ${this.form.f49}/ `;
              }
            }
          }
          if (dataObj.zhuangbeidata) {
            dataObj.zhuangbeidata.forEach((r) => {
              if (r.ownAssetCount > 0 && r.assetModule.name != "头像") {
                if (r.assetModule.name == "神品皮肤") {
                  this.form.f41 = r.ownAssetCount;
                  str = str + `红品数: ${this.form.f41}/ `;
                  // str2 = str2 + `【红品皮肤】`;
                } else if (r.assetModule.name == "极品皮肤") {
                  this.form.f50 = r.ownAssetCount;
                  str = str + `金品数: ${this.form.f50}/ \n`;
                  // str2 = str2 + `【金品皮肤】`;
                } else {
                  // str2 = str2 + `【${r.assetModule.name}】`;
                }
                r.topAssets.forEach((r2, i2) => {
                  if (r2.own) {
                    // str2 = str2 + `${r2.name}，`;
                    resultArr.push(r2);
                  }
                });
              }
            });
          }
        } else {
          // 账号有问题
          if (dataObj.code == 400) {
            this.$confirm("该账号被限制登录，点击确认前往验证！", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            })
              .then(() => {
                window.open(dataObj.errmsg.rightUrl);
              })
              .catch(() => {});
          } else {
            this.$emit("getAccountInfoEnd", 2);
            return this.$message.error(dataObj.errmsg);
          }
        }
      }
      // 匹配多选皮肤
      // resultArr;
      // 回显勾选
      let str2 = "";
      this.attrs.forEach((item) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let str3 = `${item.fieldName}：`;
          item.childAttributes.forEach((t2) => {
            resultArr.forEach((t3) => {
              if (t2.fieldName == t3.name) {
                str3 = `${str3}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
              }
            });
          });
          if (this.form[item.aavName + "rander"].length) {
            str2 = str2 + str3;
            if (str2.endsWith("，")) {
              str2 = str2.slice(0, -1);
            }
            str2 = str2 + `\n`;
          }
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
        }
        // }
      });
      this.form.des = str + str2;
      // let title = str;
      // if (str2.includes("\n")) {
      //   title = title + " " + str2.split("\n")[0];
      // }
      this.$emit("setTitle", this.form.des);
      this.$forceUpdate();
    },
    /**
     *
     * 永劫无间 自动获取皮肤数据 结束
     *
     */

    /**
     *
     *  火影忍者扫码 获取
     */
    HYRZgetQrcode() {
      this.roleHYRZlist = [];
      if (!this.form.carrierId) {
        return this.$message.error("请选择游戏运营商！");
      }
      this.$refs.HuoYingRenzhe.open(this.form.carrierId);
    },
    // 拿到火影的角色列表
    getHYRZRoleList(resData) {
      this.roleHYRZlist = [];
      if (resData && resData.cookie) {
        this.HYRZcookie = resData.cookie;
        const arr = resData.modRet.jData.areaList;
        if (arr && arr.length) {
          let defaultRole = "";
          arr.forEach((r) => {
            r.CharacName = decodeURIComponent(r.CharacName);
            if (
              !defaultRole ||
              Number(defaultRole.Level || 0) < Number(r.Level || 0)
            ) {
              // 找出级别最高的角色
              defaultRole = r;
            }
          });
          this.roleHYRZlist = [...arr];
          this.selectedHYRZrole = defaultRole.Partition;
          this.HYRZroleChange(defaultRole.Partition);
        } else {
          return this.$message.error("该账号没有角色！");
        }
      }
    },
    // 火影忍者  角色改变
    async HYRZroleChange(e) {
      console.log("%c Line:1394 🥪 e", "color:#ed9ec7", e);
      // 清空简介和自定义字段已赋值
      this.form.des = "";
      this.attrs.forEach((item) => {
        if (item.isEnable == "0") {
          this.form[item.aavName] = "";
        }

        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
        }
        this.$forceUpdate();
      });
      // 获取数据
      if (e) {
        this.roleHYRZlist.forEach((r) => {
          if (r.Partition == e) {
            this.getHYRZqqData(r);
          }
        });
      }
    },
    async getHYRZqqData(role) {
      console.log("%c Line:1418 🍣 role", "color:#e41a6a", role);
      this.form.f12 = role.Partition;
      // 获取数据
      let resData;
      try {
        if (this.form.carrierId == 42198) {
          // QQ大区
          resData = await infoApi.HYRZgetDataQQ({
            cookie: this.HYRZcookie,
            partition: role.Partition,
            platid: role.PlatId,
            areaId: role.AreaId,
          });
        } else if (this.form.carrierId == 42199) {
          // 微信
          resData = await infoApi.HYRZgetDataWX({
            cookie: this.HYRZcookie,
            partition: role.Partition,
            platid: role.PlatId,
            areaId: role.AreaId,
          });
        }
        console.log("%c Line:1422 🍊 resData", "color:#465975", resData);
        const resultArr = [];
        let allData = [];
        if (resData.data.all) {
          allData = JSON.parse(resData.data.all).list;
          console.log("%c Line:1435 🍧 allData", "color:#2eafb0", allData);
        }
        if (
          resData.data.modRet &&
          resData.data.modRet.jData.ninjaList &&
          resData.data.modRet.jData.ninjaList.length
        ) {
          const skinData = resData.data.modRet.jData.data;
          resData.data.modRet.jData.ninjaList.forEach((r) => {
            let skin = skinData[r];
            allData.forEach((r2) => {
              if (r2.rzwyID == r.slice(0, 5)) {
                const rename = r2.rzzmc.replace(/[“”]/g, "");
                skin.name = rename + (r2.rzfmc ? `「${r2.rzfmc}」` : "");
                skin = { ...r2, ...skin };
              }
            });
            resultArr.push(skin);
          });
        }
        this.getHYRZinfo(resultArr);
      } catch (error) {
        console.log("%c Line:2603 🍰 error", "color:#42b983", error);
      }
    },
    // 处理火影获取到的数据
    getHYRZinfo(data) {
      console.log(
        "%c Line:1360 🍊处理火影获取到的数据 data",
        "color:#465975",
        data
      );
      this.$store.dispatch("getShopInfo");
      let skinList = data || [];
      // 匹配多选皮肤
      // 处理简介
      let str = ``;
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinList.forEach((t3) => {
              if (t2.fieldName == t3.name) {
                const xj = t3.xj && t3.xj > 0 ? `(${t3.xj}星)` : "";
                subStr = `${subStr}${t2.fieldName}${xj}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }

                if (t3.xj) {
                  this.attrs[i1].childAttributes[i2].kz2 = t3.xj || "";
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });
      const Snum = this.form["f5rander"].length || 0;
      const Anum = this.form["f6rander"].length || 0;
      const desbefore = `${
        this.form["f5rander"].length
          ? "S忍者数:" + this.form["f5rander"].length + "-"
          : ""
      } ${
        this.form["f6rander"].length
          ? "A忍者数:" + this.form["f6rander"].length
          : ""
      }\n`;
      this.form.f1 = Snum;
      this.form.f2 = Anum;
      this.form.des = desbefore + str;
    },

    /**
     *
     *  三角洲 获取
     */
    SanJiaoZhougetQrcode() {
      this.$refs.SanJiaoZhou.open();
      // this.getSanJiaoZhouinfo(data);
      // allDatas.list
      // console.log("%c Line:1733 🍏 allDatas.list", "color:#42b983", allDatas.list);
      // // 遍历  找出匹配不上的皮肤
      // let noAttr = []
      // let pipeiAttr = []
      // let noAttrYudu = []
      // allDatas.list.forEach(r=>{
      //   let flag = false
      //   this.attrs.forEach((item) => {
      //     if (
      //       item.fieldType == "checkbox" &&
      //       item.isEnable == "0" &&
      //       item.childAttributes
      //     ) {
      //       item.childAttributes.forEach(item2=>{
      //         if(item2.fieldName==r.name){
      //           flag = true
      //           pipeiAttr.push(r)
      //         }
      //       })
      //     }
      //   })
      //   if(!flag){
      //     noAttr.push(r)
      //   }
      // })
      
      // this.attrs.forEach((item) => {
      //     if (
      //       item.fieldType == "checkbox" &&
      //       item.isEnable == "0" &&
      //       item.childAttributes
      //     ) {
      //       item.childAttributes.forEach(item2=>{
      //         let flag2 = false
      //         allDatas.list.forEach(r=>{
      //           if(item2.fieldName==r.name){
      //             flag2 = true
      //           }
      //         })
      //         if(!flag2){
      //                   noAttrYudu.push(item2)
      //           }
              
      //       })
      //     }
      //   })
      // noAttr
      // pipeiAttr
      // noAttrYudu
      // console.log("%c Line:1786 🍏 noAttrYudu", "color:#b03734", noAttrYudu);
      // console.log("%c Line:1759 🍉 pipeiAttr", "color:#33a5ff", pipeiAttr);
      // console.log("%c Line:1753 🧀 noAttr", "color:#2eafb0", noAttr);


    },

    async getSanJiaoZhouqqData(data) {
      // 清空简介和自定义字段已赋值
      this.form.des = "";
      this.attrs.forEach((item) => {
        if (item.isEnable == "0") {
          this.form[item.aavName] = "";
        }

        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
        }
        this.$forceUpdate();
      });
      // 获取数据
      this.getSanJiaoZhouinfo(data);
    },
    // 处理三角洲获取到的数据
    getSanJiaoZhouinfo(data) {
      this.$store.dispatch("getShopInfo");
      // 处理输入和单选字段
      // 战场段位  烽火段位  行动等级  战场等级  哈夫币 总资产

      this.form.f9 = 94188; // 战场段位 默认无段位
      this.form.f10 = 94197; // 烽火段位 默认无段位

      //全民战场等级 1-7 列兵、上等兵、军士长、尉官、校官、将军、统帅
      //烽火段位计算 青铜0~499 白银500~999 黄金1000~1999 铂金2000~3499 钻石3500~5999 黑鹰6000~8999 三角洲巅峰9000
      const zcdwMap = {
        1: "列兵",
        2: "上等兵",
        3: "军士长",
        4: "尉官",
        5: "校官",
        6: "将军",
        7: "统帅",
      };
      const fhdwMap = {
        1: "青铜",
        2: "白银",
        3: "黄金",
        4: "铂金",
        5: "钻石",
        6: "黑鹰",
        7: "三角洲巅峰",
      };
      let zcdw, fhdw;
      try {
        zcdw = zcdwMap[data.battle_report.stats.tdmRanklevel] || "";
        fhdw = fhdwMap[data.battle_report.stats.ranklevel] || "";
        this.attrs.forEach((r) => {
          if (r.aavName == "f9") {
            // r.childAttributes;
            // console.log("%c Line:4020 🍺 r", "color:#7f2b82", r);
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == zcdw) {
                this.form.f9 = r2.id; // 战场段位
              }
            });
          }
          if (r.aavName == "f10") {
            r.childAttributes;
            // console.log("%c Line:4020 🍺 f10", "color:#7f2b82", r);
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == fhdw) {
                this.form.f10 = r2.id; // 烽火段位
              }
            });
          }
        });
      } catch (error) {}

      this.form.f13 = data.role_info.level; // 行动等级
      this.form.f14 = data.role_info.tdmLevel; // 战场等级
      this.form.f15 = data.role_info.hafcoinnum
        ? Math.round(data.role_info.hafcoinnum / 10) / 100
        : ""; // 哈夫币
      this.form.f16 = data.role_info.totalPrice
        ? Math.round(data.role_info.totalPrice / 10000) / 100
        : ""; // 总资产

      let skin1 = data.collectibles.opers || [];
      let skin2 = data.collectibles.collectibles || [];
      const skinAll = skin1.concat(skin2);
      // 匹配多选皮肤
      // 处理简介
      let str = ``;
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinAll.forEach((t3) => {
              let isCheck = false;
              // if (t3.type == "干员皮肤") {
              //   // 干员皮肤特殊处理
              //   if (item.aavName == "f11") {
              //     if (t2.fieldName.includes(t3.name)) {
              //       isCheck = true;
              //     }
              //     if (
              //       t2.fieldName == "无名-夜鹰" &&
              //       t3.name == "暗夜猎手-夜鹰"
              //     ) {
              //       isCheck = true;
              //     }
              //     if (
              //       t2.fieldName == "露娜-黑·天际线" &&
              //       t3.name == "黑天际线-Luna联动"
              //     ) {
              //       isCheck = true;
              //     }
              //   }
              // }
              // let ydName = t2.fieldName.toLowerCase();
              // let hqName = t3.name.toLowerCase();

              // ydName = ydName.replace(/-/g, "");

              // hqName = hqName.replace("黑金玫瑰", "蚀金玫瑰");
              // hqName = hqName.replace("突击步枪-铁艺苍穹", "战斗步枪-铁艺苍穹");
              // hqName = hqName.replace(
              //   "P90冲锋枪-暗夜猎手",
              //   "P90冲锋枪-暗影猎手"
              // );
              // hqName = hqName.replace("QBZ95突击步枪", "QBZ95-1突击步枪");

              // hqName = hqName.replace(/-/g, "");

              // if (ydName == hqName) {
              //   isCheck = true;
              // }
              if (t2.sid == t3.id) {
                // const xj = t3.xj && t3.xj > 0 ? `(${t3.xj}星)` : "";
                subStr = `${subStr}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
                if (t3.quality) {
                  this.attrs[i1].childAttributes[i2].kz2 = t3.quality;
                } else if (t3.rare) {
                  let quality = "";
                  switch (t3.rare) {
                    case "至臻":
                      quality = 6;
                      break;
                    case "红":
                      quality = 6;
                      break;
                    case "橙":
                      quality = 5;
                      break;
                    case "紫":
                      quality = 4;
                      break;
                    case "蓝":
                      quality = 3;
                      break;
                    case "绿":
                      quality = 2;
                      break;
                    default:
                      quality = "";
                  }
                  this.attrs[i1].childAttributes[i2].kz2 = quality;
                }
                if (t3.img_url && !t2.imgUrl) {
                  this.attrs[i1].childAttributes[i2].imgUrl = t3.img_url;
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });
      // 总资产216M，哈夫币4064w，非洲之心，战场等级：30 军士长，行动等级：60 三角洲巅峰，角色皮肤数量6
      // 枪皮数量186，角色皮肤数量6
      let qiangpiNum =
        this.form.f1rander.length +
        this.form.f2rander.length +
        this.form.f3rander.length +
        this.form.f4rander.length +
        this.form.f5rander.length;
      const desbefore = `总资产${this.form.f16}M，哈夫币 ${
        this.form.f15
      }K，战场等级:${this.form.f14} ${zcdw}，行动等级:${
        this.form.f13
      } ${fhdw}，角色皮肤${this.form.f11rander.length || 0}，枪皮数量${
        qiangpiNum || 0
      }\n`;

      this.form.des = desbefore + str;
      // 设置标题

      this.$emit(
        "setTitle",
        this.form.des
      );
    },
    // 三角洲获取  处理结束

    // 无畏契约start
    WWGetQrcode(zwId) {
      if (zwId === 2) {
        if (!this.zwId) {
          return this.$message.error("请输入掌瓦号");
        }
        this.btnLoading = true;
        infoApi
          .WWQYgetDataById({
            id: this.zwId,
          })
          .then((res) => {
            this.btnLoading = false;
            if (res.code == 200 && res.data) {
              if(res.data.code==200&&res.data.data){
                this.getLwwinfo(res.data.data);
              }else{
                this.$message.error(res.data.msg)
              }
            }
          })
          .catch((err) => {
            this.btnLoading = false;
          });
      } else {
        this.$refs.WWAuth.open();
      }
    },
    // 获取到游戏数据
    getLwwinfo(data) {
      this.$store.dispatch("getShopInfo");
      // this.form.wuweidian = data.costNum;
      // this.form.yuanjingdian = data.rNum;
      // this.form.level = data.level;
      // this.form.heroNum = data.heroNum;
      // this.form.skinNum = data.skinNum;
      const tempArr = (data.skinJsonList || [])
        .concat(data.charmList || [])
        .concat(data.cardList || [])
        .concat(data.sprayList || []);
      let skinList = tempArr || [];
      this.form.f34 = data.rNum; //已用源晶点
      this.form.f23 = data.level ? data.level.split("|")[0] : ""; //等级
      this.form.f27 = data.costNum; //皮肤价值
      this.form.f35 = data.heroNum; //解锁英雄数
      // // 处理区服 暂时写死
      // this.form.groupId = 54660
      // this.form.groupName = 'QQ全区'
      // this.form.serverId = 54662
      // this.form.serverName = 'QQ全服'
      // // // 获取服务器
      // gameDictionaryApi
      //   .getList({
      //     parentId: this.form.groupId,
      //   })
      //   .then((res2) => {
      //     this.serverList = res2.rows;
      //   });
      // 匹配多选皮肤
      // 处理简介
      let str = ` ${data.level ? "等级:" + data.level + "/" : ""} ${
        data.rNum ? "已用源晶点:" + data.rNum + "/" : ""
      }  ${data.costNum ? "皮肤价值:" + data.costNum + "/" : ""} ${
        data.heroNum ? "英雄数:" + data.heroNum + "/" : ""
      } \n `;

      // 处理套装
      const bundleJsonList = data.bundleJsonList || [];
      // 处理英雄
      const heroJsonList = data.heroList || [];

      this.attrs.forEach((item) => {
        // if (this.form[item.aavName]) {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2) => {
            // 处理套装
            if (item.fieldKey == "bundleKey") {
              if (bundleJsonList && bundleJsonList.length) {
                bundleJsonList.forEach((bundle) => {
                  // 勾选 选中
                  if (bundle.bundleId == t2.sid && bundle.isLock === 0) {
                    // 选中的套装
                    if (
                      this.form[item.aavName + "rander"].indexOf(t2.id) == -1
                    ) {
                      this.form[item.aavName + "rander"].push(t2.id);
                    }
                  }
                  // 拼装简介
                  if (bundle.bundleId == t2.sid && bundle.skinNameList) {
                    subStr = `${subStr} ${t2.fieldName}（${bundle.skinNameList}）`;
                  }
                });
              }
            } else if (item.fieldKey == "hero") {
              // 处理英雄
              if (heroJsonList && heroJsonList.length) {
                heroJsonList.forEach((hero) => {
                  // 勾选 选中
                  if (hero.id == t2.sid) {
                    // 选中
                    if (
                      this.form[item.aavName + "rander"].indexOf(t2.id) == -1
                    ) {
                      this.form[item.aavName + "rander"].push(t2.id);
                    }
                  }
                  // 拼装简介
                  if (hero.id == t2.sid) {
                    subStr = `${subStr} ${t2.fieldName}`;
                  }
                });
              }
            } else {
              // 处理被勾选的简介
              skinList.forEach((t3) => {
                if (t2.sid == t3.skinId || t2.sid == t3.sid) {
                  if (t3.xuancai) {
                    subStr = `${subStr} ${t2.fieldName}(炫彩)`;
                  } else {
                    subStr = `${subStr} ${t2.fieldName}`;
                  }

                  if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                    this.form[item.aavName + "rander"].push(t2.id);
                    if (t3.xuancai) {
                      this.form["xuancai" + t2.id] = true;
                    } else {
                      this.form["xuancai" + t2.id] = false;
                    }
                  }
                }
              });
            }
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");

          if (item.key == "bundleKey" || item.key == "hero") {
            if (subStr) {
              str = `${str}【${item.fieldName}】 ${subStr} \n `;
            }
          } else {
            if (this.form[item.aavName + "rander"].length) {
              str = `${str}【${item.fieldName}】 ${subStr} \n `;
            }
          }

          this.$forceUpdate();
        }
        // }
      });
      this.form.des = str;
      // // 找出游戏下标  校验表单
      // let index = 0;
      // this.gameList.forEach((t, i) => {
      //   if (t.name == this.actived) {
      //     index = i;
      //   }
      // });
      // this.$refs["form"].validate((valid) => {});
      // this.$refs["form" + index][0].validate((valid) => {});
    },
    //无畏契约 end

    /**
     *
     * LOL自动获取
     *
     * */
    lolGetQrcode(type) {
      if (type == "LOLM") {
        // LOL 手游
        if (!this.form.carrierId) {
          return this.$message.error("请先选择运营商！");
        }
        this.$refs.lolAuth.open(type, this.form.carrierId);
      } else {
        this.$refs.lolAuth.open(type);
      }
    },
    // 获取到游戏数据
    getLOLinfo(data) {
      this.$store.dispatch("getShopInfo");
      ////console.log("%c Line:925 🍉 res", "color:#ed9ec7", data);
      if (data.type == "LOL") {
        // this.form.f16 = res.data.wangpaiLevel
        this.form.f3 = data.hero_num; //英雄数
        this.form.f4 = data.skin_num; //皮肤数
        this.form.f5 = data.xuancai; //炫彩数
        this.form.f2 = data.levelCode; //段位
        this.form.f21 = data.riotPoints; //点券
        this.form.f22 = data.influencePoints; //精碎
        this.form.f23 = data.zhencaiNum; //臻彩数量
        this.form.f31 = data.level; //臻彩数量
        let skinList = data.skinList;
        let myZhenCai = data.myZhenCai;

        // // // 处理区服
        // if (this.areaList && this.areaList.length) {
        //   this.areaList.forEach((t1) => {
        //     if (t1.fieldName == data.group) {
        //       this.form.groupId = t1.id;
        //       this.form.groupName = t1.fieldName;
        //       // 获取服务器
        //       gameDictionaryApi
        //         .getList({
        //           parentId: t1.id,
        //         })
        //         .then((res2) => {
        //           this.serverList = res2.rows;
        //           this.serverList.forEach((i) => {
        //             if (i.fieldName == data.server) {
        //               this.form.serverName = i.fieldName;
        //               this.form.serverId = i.id;
        //             }
        //           });
        //         });
        //     }
        //   });
        // }

        // 匹配多选皮肤
        // 处理简介
        let str = "";
        // skinList
        // 回显勾选
        this.attrs.forEach((item) => {
          // if (this.form[item.aavName]) {
          if (
            item.fieldType == "checkbox" &&
            item.isEnable == "0" &&
            item.childAttributes
          ) {
            this.form[item.aavName + "rander"] = [];
            item.childAttributes.forEach((t2) => {
              skinList.forEach((t3) => {
                if (t2.sid == t3) {
                  str = `${str} ${t2.fieldName}`;

                  if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                    this.form[item.aavName + "rander"].push(t2.id);
                  }
                }
              });
              if (item.aavName == "f24") {
                myZhenCai.forEach((t3) => {
                  if (t2.fieldName == t3) {
                    str = `${str} ${t2.fieldName}`;

                    if (
                      this.form[item.aavName + "rander"].indexOf(t2.id) == -1
                    ) {
                      this.form[item.aavName + "rander"].push(t2.id);
                    }
                  }
                });
              }
            });
            let str2 = `${this.form.f3}英雄-${this.form.f4}皮肤-${this.form.f5}炫彩-段位：${data.levelName}`;
            this.form.des = str2 + str;
            this.form[item.aavName] =
              this.form[item.aavName + "rander"].join(",");
            this.$forceUpdate();
          }
          // }
        });
        // 匹配输入框中各类皮肤数
        // 神话
        this.form.f18 = this.form.f23rander.length || 0;
        // 限定
        this.form.f19 = this.form.f7rander.length || 0;
        // 传说
        this.form.f20 = this.form.f22rander.length || 0;

        // 找出游戏下标  校验表单
        // let index = 0;
        // this.gameList.forEach((t, i) => {
        //   if (t.name == this.actived) {
        //     index = i;
        //   }
        // });
        this.$refs["formRel"].validate((valid) => {});
      } else if (data.type == "LOLM") {
        this.form.f5 = Number(data.heroCount || 0); //英雄数
        this.form.f6 = Number(data.skinCount || 0); //皮肤数
        let skinList = data.skinList;
        // // 处理区服
        // this.form.systemId = Number(data.system);
        // this.form.systemName = data.systemName;
        // this.form.carrierId = Number(data.carrier);
        // this.form.groupId = Number(data.group);
        // this.form.serverId = Number(data.serve);
        // 获取大区
        // if (this.carrierList && this.carrierList.length) {
        //   this.carrierList.forEach((t1) => {
        //     if (t1.id == data.carrier) {
        //       this.form.carrierId = t1.id;
        //       this.form.carrierName = t1.fieldName;
        //       let obj = {
        //         gameId: "25",
        //         systemKey: t1.systemKey + "group",
        //       };
        //       gameDictionaryApi.getChildList(obj).then((res) => {
        //         this.areaList = res.rows;
        //         this.form.groupName = res.rows[0].fieldName;
        //         this.form.groupId = res.rows[0].id;
        //         gameDictionaryApi
        //           .getList({
        //             parentId: res.rows[0].id,
        //           })
        //           .then((res2) => {
        //             this.serverList = res2.rows;
        //             this.form.serverName = res2.rows[0].fieldName;
        //             this.form.serverId = res2.rows[0].id;
        //           });
        //       });
        //     }
        //   });
        // }
        // 匹配多选皮肤
        // 处理简介
        let str = "";
        // skinList
        // 回显勾选
        this.attrs.forEach((item) => {
          // if (this.form[item.aavName]) {
          if (
            item.fieldType == "checkbox" &&
            item.isEnable == "0" &&
            item.childAttributes
          ) {
            this.form[item.aavName + "rander"] = [];
            item.childAttributes.forEach((t2) => {
              skinList.forEach((t3) => {
                if (t2.sid == t3.skin_id) {
                  str = `${str},${t2.fieldName}`;
                  if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                    this.form[item.aavName + "rander"].push(t2.id);
                  }
                }
              });
            });
            let str2 = `${this.form.f5}英雄-${this.form.f6}皮肤`;
            this.form.des = str2 + str;
            this.form[item.aavName] =
              this.form[item.aavName + "rander"].join(",");
            this.$forceUpdate();
          }
          // }
        });
        // // 找出游戏下标  校验表单
        // let index = 0;
        // this.gameList.forEach((t, i) => {
        //   if (t.name == this.actived) {
        //     index = i;
        //   }
        // });
        // this.$refs["form"].validate((valid) => {});
      }
    },
    /**
     *
     * LOL自动获取  结束
     *
     * */

    /**
     *
     *  穿越火线 获取 start
     */

    //获取角色列表
    getQRcodeCF() {
      this.$refs.QiangzhanWangzhe.open('','穿越火线');
     
     
      // this.showCFCheckbox(data)
    },
    // 去重并统计重名数量
    countAndDeduplicate(arr) {
      const countMap = arr.reduce((map, item) => {
        map.set(item.szName, (map.get(item.szName) || 0) + 1);
          return map;
        }, new Map());
        
        const seen = new Set();
        return arr.filter(item => {
          if (seen.has(item.szName)) return false;
          seen.add(item.szName);
          return true;
        }).map(item => ({
          ...item,
          number: countMap.get(item.szName)
        }));
    },

    //  回显 穿越火线 拼装简介
    showCFCheckbox(data) {
      // CF
       if (data.userInfo) {
        this.form.f27 = data.userInfo.mp || ""; //CF点
        this.form.f26 = data.userInfo.sort || ""; //段位排名
        this.form.f28 = data.userInfo.gamePoint || ""; //GP点
      }
      let csjs = 0
      let wzjs = 0
      let ljjs = 0
      let yxjs = 0
      if(data.charListResult&&data.charListResult.length){
        // 角色数
        this.form.f31 = data.charListResult.length
        data.charListResult.forEach(r=>{
          if(r.propLevel==1){
            // 传说角色
            csjs++
          }
          if(r.propLevel==2){
            // 王者角色
            wzjs++
          }
          if(r.propLevel==3){
            // 炼金角色
            ljjs++
          }
          if(r.propLevel==4){
            // 英雄角色
            yxjs++
          }
        })
        this.form.f33 = csjs
        this.form.f30 = wzjs
        // this.form.f33 = ljjs
        this.form.f11 = yxjs
      }

      let cswq = 0
      let wzwq = 0
      let ljwq = 0
      let yxwq = 0
      if(data.weaponListResult&&data.weaponListResult.length){
        // 武器
        data.weaponListResult.forEach(r=>{
          if(r.propLevel==1){
            // 传说
            cswq++
          }
          if(r.propLevel==2){
            // 王者
            wzwq++
          }
          if(r.propLevel==3){
            // 炼金
            ljwq++
          }
          if(r.propLevel==4){
            // 英雄
            yxwq++
          }
        })
        this.form.f32 = cswq
        this.form.f9 = wzwq
        this.form.f10 = ljwq
        this.form.f8 = yxwq
      }

      let skin1 = data.charListResult || [];
      let skin2 = data.weaponListResult || [];
      let skin3 = data.propListInGame || [];
      let skin4 = data.gameYinXCardList || [];
      const tempAll = skin1.concat(skin2).concat(skin3).concat(skin4);
      // 计算相同装备的数量
      const skinAll = this.countAndDeduplicate(tempAll)

      // 匹配多选皮肤
      // 处理简介
      let str = "";
      this.attrs.forEach((item, i1) => {
        if(item.aavName== 'f6'){
          // 段位
          try {
            const duanwei = data.userInfo.btnList[0].rankInfo.name
            item.childAttributes&&item.childAttributes.forEach(r=>{
              if(!duanwei.includes('枪王')&& duanwei.includes(r.fieldName)){
                this.form.f6 = r.id
              }else if(duanwei.includes('枪王')){
                if(duanwei.includes('荣耀枪王')){
                  this.form.f6 = 39890
                }
                else if(duanwei.includes('枪王之王')){
                  this.form.f6 = 39891
                }
                else{
                  this.form.f6 = 39889
                }

              }
            })
          } catch (error) {
            
          }
        }
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinAll.forEach((t3) => {
              let isCheck = false;
              if (t2.fieldName == t3.szName || isCheck) {
                // const xj = t3.xj && t3.xj > 0 ? `(${t3.xj}星)` : "";
                subStr = `${subStr}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
                if (t3.propLevel) {
                  this.attrs[i1].childAttributes[i2].kz1 = t3.propLevel;
                } 
                if(!t2.imgUrl){
                  if(t3.szBigPic){
                    this.attrs[i1].childAttributes[i2].imgUrl = t3.szBigPic;
                  }else if (t3.szScreenPic) {
                    // 取出皮肤图
                    const combineUrlWithFirstImage = t3.szScreenPic.replace(/\[.*?"([^"]+)".*\]/, '$1');
                    this.attrs[i1].childAttributes[i2].imgUrl = combineUrlWithFirstImage;
                  }
                }
                if(t3.number>1){
                  this.attrs[i1].childAttributes[i2].kz2 = t3.number
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });
      // VIP${'0'}，
      const desbefore = `${data.roleInfo&&data.roleInfo.serverName? data.roleInfo.serverName :''}，等级${data.roleInfo.level}，${cswq>0?'传说武器'+cswq+'，':''}${wzwq>0?'王者武器'+wzwq+'，':''}${ljwq>0?'炫金武器'+ljwq+'，':''}${yxwq>0?'V武器'+ yxwq+'，':''}\n`;
      this.form.des = desbefore + str;
      // 设置标题
      this.$emit(
        "setTitle",
        this.form.des
      );

      this.$refs["formRel"].validate((valid) => {});
    },
    /**
     *
     *  穿越火线 获取 end
     */

    /**
     *
     *  金铲铲 获取 start
     */

    //获取角色列表
    getQRcodeJCC() {
      this.$refs.JCCAuth.open();
    },

    getJCCinfo(data) {
      console.log("%c Line:1340 🍔 data", "color:#4fff4B", data);
      this.$store.dispatch("getShopInfo");
      this.form.f11 = data.level || ""; //等级
      this.form.f12 = data.heroNum || ""; //英雄数
      this.form.f13 = data.mapNum || ""; //棋盘数
      this.form.f14 = data.attNum || ""; //特效数
      // // 处理区服
      // this.form.systemId = Number(data.systemId);
      // this.form.systemName = data.systemName;
      // this.form.carrierId = Number(data.carrier);
      // // 获取大区
      // if (this.carrierList && this.carrierList.length) {
      //   this.carrierList.forEach((t1) => {
      //     if (t1.id == data.carrier) {
      //       this.form.carrierId = t1.id;
      //       this.form.carrierName = t1.fieldName;
      //       let obj = {
      //         gameId: "16",
      //         systemKey: t1.systemKey + "group",
      //       };
      //       gameDictionaryApi.getChildList(obj).then((res) => {
      //         this.areaList = res.rows;
      //         this.form.groupName = res.rows[0].fieldName;
      //         this.form.groupId = res.rows[0].id;
      //         gameDictionaryApi
      //           .getList({
      //             parentId: res.rows[0].id,
      //           })
      //           .then((res2) => {
      //             this.serverList = res2.rows;
      //             this.form.serverName = res2.rows[0].fieldName;
      //             this.form.serverId = res2.rows[0].id;
      //           });
      //       });
      //     }
      //   });
      // }
      this.showJCCCheckbox(data);
    },
    //  回显  拼装简介
    showJCCCheckbox(res) {
      let data = res;
      let str = "";
      let arr;
      arr = data.skinList;
      if (data.attJson && data.attJson.length) {
        arr = arr.concat(data.attJson);
      }
      if (data.mapJson && data.mapJson.length) {
        arr = arr.concat(data.mapJson);
      }
      // console.log("%c Line:518 🍡 营地数据arr", "color:#4fff4B", arr);
      // if (arr && arr.length) {
      //   arr.forEach((r) => {
      //     str = `${str} ${r.name}`;
      //   });
      // }
      let str2 = `小小英雄:${data.heroNum}  等级:${data.level} 棋盘:${data.mapNum} 攻击特效:${data.attNum} `;

      // 回显
      // 回显勾选
      this.attrs.forEach((item) => {
        // if (this.form[item.aavName]) {
        this.form[item.aavName + "rander"] = [];
        if (item.fieldType == "checkbox" && item.childAttributes) {
          let strtemp = "";
          item.childAttributes.forEach((t2) => {
            arr.forEach((t3) => {
              if (t3 && t2.sid == t3.id) {
                // str = `${str} ${t2.fieldName}`
                strtemp = `${strtemp} ${t2.fieldName}`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
              }
            });
          });
          if (strtemp) {
            str = `${str} \n【${item.fieldName}】 ${strtemp}`;
          }
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          this.$forceUpdate();
        }
        // }
      });
      this.form.des = str2 + str;
      // this.form.f11 = this.form["f19rander"].length || "";
      // // 找出游戏下标
      // let index = 0;
      // this.gameList.forEach((t, i) => {
      //   if (t.name == this.actived) {
      //     index = i;
      //   }
      // });
      // this.$refs["form"].validate((valid) => {});
    },
    /**
     *
     *  金铲铲 获取 end
     */

     /**
     *
     *  枪战王者 获取
     */
     QzwzGetQrcode() {
      this.$refs.QiangzhanWangzhe.open(this.form.carrierId);

      // this.getQiangzhanWangzheData(qiangzhandata)
    },

    async getQiangzhanWangzheData(data) {
      // 清空简介和自定义字段已赋值
      this.form.des = "";
      this.attrs.forEach((item) => {
        if (item.isEnable == "0") {
          this.form[item.aavName] = "";
        }

        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
        }
        this.$forceUpdate();
      });
      // 获取数据
      if(data.gameType=='穿越火线'){
        this.showCFCheckbox(data.data)
      }else{
        this.getQiangzhanWangzhenfo(data.data);
      }
      
    },
    // 处理枪战王者 获取到的数据
    getQiangzhanWangzhenfo(data) {
      // console.log("%c Line:2637 🍢 data", "color:#465975", data);
      this.$store.dispatch("getShopInfo");
      // 处理输入和单选字段
      try {
        this.attrs.forEach((r) => {
          if (r.aavName == "f20") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == data.userInfo.rankLevel) {
                this.form.f20 = r2.id; // 段位
              }
            });
          }
          if (r.aavName == "f2") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == 'V'+ data.userInfo.vipLevel) {
                this.form.f2 = r2.id; // VIP等级
              }
            });
          }
        });
      } catch (error) {}

      this.form.f1 = data.userInfo.level; // 等级
      this.form.f3 = data.userInfo.jobName; // 军衔

      // 处理V总数 V角色 万化数
      let Vnum = 0
      let Vjuese = 0
      let Vwuqi = 0
      let wanhua = 0
      data.charListResult.forEach(r=>{
        if(r.propLevel==1||r.propLevel==2||r.propLevel==3){
          Vnum++
          Vjuese++
        }
      })
      data.weaponListResult.forEach(r=>{
        if(r.propLevel==1||r.propLevel==2||r.propLevel==3){
          Vnum++
          Vwuqi++
        }
        if(r.iIsWanHua==1){
          wanhua++
        }
      })
      // if(Vnum){
      //   this.form.f4 = Vnum
      // }
      if(Vjuese){
        this.form.f17 = Vjuese
      }
      if(Vwuqi){
        this.form.f5 = Vwuqi
      }
      if(wanhua){
        console.log("%c Line:2694 🍯 wanhua", "color:#b03734", wanhua);
        this.form.f18 = wanhua
      }

      let skin1 = data.charListResult || [];
      let skin2 = data.weaponListResult || [];
      const skinAll = skin1.concat(skin2);
      // 匹配多选皮肤
      // 处理简介
      let str = ``;
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinAll.forEach((t3) => {
              let isCheck = false;
              if (t2.fieldName == t3.szName || isCheck) {
                // const xj = t3.xj && t3.xj > 0 ? `(${t3.xj}星)` : "";
                subStr = `${subStr}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
                if (t3.propLevel) {
                  this.attrs[i1].childAttributes[i2].kz1 = t3.propLevel;
                } 
                if (t3.iIsWanHua==1) {
                  this.attrs[i1].childAttributes[i2].kz2 = 1;
                } 
                if ((t3.szBigPic) && !t2.imgUrl) {
                  this.attrs[i1].childAttributes[i2].imgUrl = t3.szBigPic;
                }
                if ((t3.szScreenPic) && !t2.imgUrl) {
                  // 取出角色图
                  const combineUrlWithFirstImage = t3.szScreenPic.replace(/\[.*?"([^"]+)".*\]/, '$1');
                  this.attrs[i1].childAttributes[i2].imgUrl = combineUrlWithFirstImage;
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });

      // 王者武器数量 从已勾选的取来
      this.form.f14 = this.form.f11rander.length||0;
      const desbefore = `${data.userInfo.areaName||''}，等级${this.form.f1}，VIP${
        data.userInfo.vipLevel
      }，V武器数:${Vwuqi} ，V角色数:${
        Vjuese
      } \n`;
      this.form.des = desbefore + str;
      // 设置标题
      this.$emit(
        "setTitle",
        this.form.des
      );
    },
    // 枪战王者  处理结束

     /**
     *
     *  QQ飞车 获取
     */
     QQspeedGetQrcode() {
      const type = this.form.gameId==7?'QQ飞车':'QQ飞车手游'
      let qufu = 'qq'
      if(this.form.gameId == 14&&this.form.carrierId==44033){
        qufu = 'wx'
      }
      this.$refs.QQspeed.open(type,qufu);


      this.getQQspeedData(feicheData)
    },

    async getQQspeedData(data) {
      // console.log("%c Line:2794 🍊 data", "color:#33a5ff", data);
      // 清空简介和自定义字段已赋值
      this.form.des = "";
      this.attrs.forEach((item) => {
        if (item.isEnable == "0") {
          this.form[item.aavName] = "";
        }

        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
        }
        this.$forceUpdate();
      });
      this.$store.dispatch("getShopInfo");
      if(this.form.gameId==7){
        // 获取数据
        this.getQQspeedInfo(data);
      }else{
        // 获取数据
        this.getQQspeedInfoM(data);
      }
      
    },
    // 处理QQ飞车 获取到的数据
    getQQspeedInfo(data) {
      console.log("%c Line:2637 🍢 data", "color:#465975", data);
      this.$emit("getAccountInfoEnd", 1,data);
      // 钻7皇7，魅力62000
      // 角色名称
      this.form.f7 = data.userInfo.roleName
      // 处理紫钻和皇族 字段
      try {
        this.attrs.forEach((r) => {
          if (r.aavName == "f8") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == data.privilege['紫钻']) {
                this.form.f8 = r2.id; // 紫钻
              }
            });
          }
          if (r.aavName == "f9") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == data.privilege['皇族']) {
                this.form.f9 = r2.id; // 皇族
              }
            });
          }
        });
      } catch (error) {}

      this.form.f10 = data.privilege['魅力值']; // 魅力值
      let A = data.getspeedKnapsack.carList.carA || [];
      let S = data.getspeedKnapsack.carList.carS || [];
      let T1 = data.getspeedKnapsack.carList.carT1 || [];
      let T2 = data.getspeedKnapsack.carList.carT2 || [];
      let T3 = data.getspeedKnapsack.carList.carT3 || [];
      const skinAll = T3.concat(T2).concat(T1).concat(S).concat(A)
      // 匹配多选皮肤
      // 处理简介
      let str = ``;
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinAll.forEach((t3) => {
              if (t2.fieldName == t3.name) {
                subStr = `${subStr}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
                // if (t3.propLevel) {
                //   this.attrs[i1].childAttributes[i2].kz1 = t3.propLevel;
                // } 
                // if (t3.iIsWanHua==1) {
                //   this.attrs[i1].childAttributes[i2].kz2 = 1;
                // } 
                if (t3.icon && !t2.imgUrl) {
                  this.attrs[i1].childAttributes[i2].imgUrl = t3.icon;
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });

      const desbefore = `${data.userInfo['areaName']}/${data.privilege['紫钻']>'Lv0'?('紫钻'+data.privilege['紫钻']+'/'):''}${data.privilege['皇族']>'Lv0'?('皇族'+data.privilege['皇族']+'/'):''} 魅力值${data.privilege['魅力值']}/${T3&&T3.length?T3.length+'T3机甲/ ':''}${T2&&T2.length?T2.length+'T2机甲/ ':''}${T1&&T1.length?T1.length+'T1机甲/ ':''}${S&&S.length?S.length+'S车/ ':''}${A&&A.length?A.length+'A车 ':''}\n`;
      this.form.des = desbefore + str;
      // 设置标题
      this.$emit(
        "setTitle",
        this.form.des
      );
    },
    // 处理QQ飞车手游  获取到的数据
    getQQspeedInfoM(data) {
      console.log("%c Line:2906 🥥 data", "color:#42b983", data);
      this.form.f15 = data.userInfo.level
      // 处理输入和单选字段
      try {
        this.attrs.forEach((r) => {
          if (r.aavName == "f20") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == data.userInfo.rankLevel) {
                this.form.f20 = r2.id; // 段位
              }
            });
          }
          if (r.aavName == "f2") {
            r.childAttributes.forEach((r2) => {
              if (r2.fieldName == 'V'+ data.userInfo.vipLevel) {
                this.form.f2 = r2.id; // VIP等级
              }
            });
          }
        });
      } catch (error) {}

      this.form.f1 = data.userInfo.level; // 等级
      this.form.f3 = data.userInfo.jobName; // 军衔

      // 处理V总数 V角色 万化数
      let Vnum = 0
      let Vjuese = 0
      let Vwuqi = 0
      let wanhua = 0
      data.charListResult.forEach(r=>{
        if(r.propLevel==1||r.propLevel==2||r.propLevel==3){
          Vnum++
          Vjuese++
        }
      })
      data.weaponListResult.forEach(r=>{
        if(r.propLevel==1||r.propLevel==2||r.propLevel==3){
          Vnum++
          Vwuqi++
        }
        if(r.iIsWanHua==1){
          wanhua++
        }
      })
      // if(Vnum){
      //   this.form.f4 = Vnum
      // }
      if(Vjuese){
        this.form.f17 = Vjuese
      }
      if(Vwuqi){
        this.form.f5 = Vwuqi
      }
      if(wanhua){
        console.log("%c Line:2694 🍯 wanhua", "color:#b03734", wanhua);
        this.form.f18 = wanhua
      }

      let skin1 = data.charListResult || [];
      let skin2 = data.weaponListResult || [];
      const skinAll = skin1.concat(skin2);
      // 匹配多选皮肤
      // 处理简介
      let str = ``;
      this.attrs.forEach((item, i1) => {
        if (
          item.fieldType == "checkbox" &&
          item.isEnable == "0" &&
          item.childAttributes
        ) {
          this.form[item.aavName + "rander"] = [];
          let subStr = "";
          item.childAttributes.forEach((t2, i2) => {
            // 处理被勾选的
            skinAll.forEach((t3) => {
              let isCheck = false;
              if (t2.fieldName == t3.szName || isCheck) {
                // const xj = t3.xj && t3.xj > 0 ? `(${t3.xj}星)` : "";
                subStr = `${subStr}${t2.fieldName}，`;
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
                if (t3.propLevel) {
                  this.attrs[i1].childAttributes[i2].kz1 = t3.propLevel;
                } 
                if (t3.iIsWanHua==1) {
                  this.attrs[i1].childAttributes[i2].kz2 = 1;
                } 
                if (t3.szBigPic && !t2.imgUrl) {
                  this.attrs[i1].childAttributes[i2].imgUrl = t3.szBigPic;
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          if (this.form[item.aavName + "rander"].length) {
            str = `${str}【${item.fieldName}】${subStr}\n`;
          }
          this.$forceUpdate();
        }
      });

      // 王者武器数量 从已勾选的取来
      this.form.f14 = this.form.f11rander.length||0;
      const desbefore = `${data.userInfo.areaName||''}，等级${this.form.f1}，VIP${
        data.userInfo.vipLevel
      }，V武器数:${Vwuqi} ，V角色数:${
        Vjuese
      } \n`;
      this.form.des = desbefore + str;
      // 设置标题
      this.$emit(
        "setTitle",
        this.form.des
      );
    },
    // QQ飞车  处理结束


    // 获取系统列表
    getSysList() {
      gameDictionaryApi
        .getChildList({
          gameId: this.form.gameId,
          systemKey: "system",
        })
        .then((res) => {
          this.sysList = res.rows;

          this.sysList.forEach((i) => {
            if (this.form.systemId && i.id == this.form.systemId) {
              this.form.systemName = i.fieldName;
              i.leaf = false;
            }
          });
          if (this.form.gameType == 1) {
            // 端游
          } else {
            // 手游
            this.qufuList = this.sysList;
          }
        });
    },
    // 编辑时回显手游区服

    // 编辑时回显 大区 服务器
    reViewArea() {
      this.form.gameType = Number(this.form.gameType);
      if (this.form.gameType == 1) {
        // 端游
        this.getAreaList("", true, this.form.groupId);
      } else {
        this.getSysList();
        this.getYysList(true, this.form.carrierId, this.form.groupId);
      }
    },
    // 系统改变
    sysChange(e) {
      if (e) {
        this.sysList.forEach((i) => {
          if (i.id == e) {
            this.form.systemName = i.fieldName;
          }
        });
      } else {
        this.form.systemName = "";
      }
      this.$set(this.form, "isAutoImg", 1);
    },
    // 服务器改变
    serverChange(e) {
      // ////console.log("%c Line:353 🍺 e", "color:#7f2b82", e);
      if (e) {
        this.serverList.forEach((i) => {
          if (i.id == e) {
            this.form.serverName = i.fieldName;
            this.$set(this.form, "serverId", e);
            this.$forceUpdate();
            // this.form.serverId = e
          }
        });
      } else {
        this.form.serverName = "";
      }
    },
    // 获取运营商列表
    async getYysList(flag, yysId, areaId) {
      try {
        const res = await gameDictionaryApi.getChildList({
          gameId: this.form.gameId,
          systemKey: "carrier",
        });
        this.carrierList = res.rows;
        if (flag) {
          // 回显的时候，获取下一级
          this.getAreaList(yysId, true, areaId);
        }
      } catch (error) {}
    },
    // 运营商改变  获取大区列表
    getAreaList(e, flag, areaId) {
      this.$set(this.form, "isAutoImg", 1);
      let obj = {
        gameId: this.form.gameId,
        systemKey: "group",
      };
      if (!flag) {
        // 不是回显的时候，再清除后面的选中
        this.form.groupName = "";
        this.form.groupId = "";
        this.form.serverName = "";
        this.form.serverId = "";
      } else {
        // 回显时，请求服务器列表
        this.getServiceList(areaId, true);
      }

      // 运营商改变 找出选择的运营商的对象
      if (e) {
        this.carrierList.forEach((i) => {
          if (i.id == e) {
            obj.systemKey = i.systemKey + "group";
            this.form.carrierName = i.fieldName;
          }
        });
      } else {
        this.form.carrierName = "";
      }
      gameDictionaryApi.getChildList(obj).then((res) => {
        this.areaList = res.rows;
        if (this.areaList.length == 1 && !flag) {
          this.form.groupId = this.areaList[0].id;
          this.form.groupName = this.areaList[0].fieldName;
          this.getServiceList(this.areaList[0].id, flag);
        }
        this.areaList.forEach((r) => {
          r.leaf = false;
          if (this.form.groupId && r.id == this.form.groupId) {
            this.form.groupName = r.fieldName;
          }
        });
        if (this.form.gameType == 1) {
          // 端游
          this.qufuList = this.areaList;
        }
      });
    },
    // 大区改变  获取服务器列表
    getServiceList(e, flag) {
      ////console.log("%c Line:1417 🍺 e", "color:#42b983", e);

      if (this.form.gameType == 1) {
        this.$set(this.form, "isAutoImg", 1);
      }
      this.form.groupId = e;
      if (!flag) {
        // 不是回显的时候，再清除后面的选中
        this.form.serverName = "";
        this.form.serverId = "";
      }

      if (e) {
        gameDictionaryApi
          .getList({
            parentId: e,
          })
          .then((res) => {
            this.serverList = res.rows;
            if (this.serverList.length == 1) {
              this.form.serverId = this.serverList[0].id;
              this.form.serverName = this.serverList[0].fieldName;
            }
            if (this.form.serverId) {
              this.serverList.forEach((i) => {
                if (i.id == this.form.serverId) {
                  this.form.serverName = i.fieldName;
                }
              });
            }
          });
        this.areaList.forEach((i) => {
          if (i.id == e) {
            this.form.groupName = i.fieldName;
          }
        });
      } else {
        this.form.groupName = "";
        this.serverList = [];
      }
    },
    // 获取游戏属性列表
    getAttrList() {
      this.loading = true;
      let formData = JSON.parse(JSON.stringify(this.form));
      // 请求自定义字段
      gameConfigApi.getGameConfig({ gameId: formData.gameId }).then((res) => {
        this.loading = false;
        if (res.code == 200) {
          let attrs = [];
          this.resetRules();
          if (res.rows.length) {
            res.rows.forEach((r) => {
              if(this.retal) {
                if(r.isRental === 1 && r.isEnable === "0") {
                  attrs.push(r);
                }
              }else {
                if (r.isEnable === "0") {
                  attrs.push(r);
                }
              }
             
              if (r.fieldType == "checkbox") {
                this.$set(
                  formData,
                  r.aavName + "rander",
                  formData[r.aavName] ? formData[r.aavName].split(",") : []
                );
                let arr = [];
                if (
                  formData[r.aavName + "rander"] &&
                  formData[r.aavName + "rander"].length
                ) {
                  formData[r.aavName + "rander"].forEach((t) => {
                    arr.push(Number(t));
                  });
                }
                formData[r.aavName + "rander"] = arr;
              } else if (r.fieldType == "boxradio") {
                // 原神的特殊多选，多选套单选的数据处理
                if (formData[r.aavName]) {
                  // 如果有选中项
                  let idsArr = formData[r.aavName].split(",");
                  r.childAttributes.forEach((first, ind) => {
                    if(first.childAttributes){
                      first.childAttributes.forEach((sec) => {
                        if (idsArr.includes(String(sec.id))) {
                          formData[r.aavName + ind] = sec.id;
                          first.ischeck = true;
                          first.fieldName =
                            first.fieldName + "(" + sec.fieldName + ")";
                        }
                      });
                    }
                    
                  });
                } else {
                  r.childAttributes.forEach((first) => {
                    first.ischeck = false;
                  });
                }
              } else if (r.fieldType == "radio") {
                this.$set(
                  formData,
                  r.aavName,
                  formData[r.aavName] ? Number(formData[r.aavName]) : ""
                );
              }
              if (r.fieldType == "number" && r.must != "true") {
                // 非必填的默认0
                this.$set(
                  formData,
                  r.aavName,
                  formData[r.aavName] ? formData[r.aavName] : 0
                );
              }
              if (r.isEnable === "0" && r.must == "true") {
                if (r.fieldType == "number") {
                  this.$set(this.rules, r.aavName, [
                    {
                      required: true,
                      message: `请输入${r.fieldName}`,
                      trigger: "change",
                    },
                    { pattern: /^\d+(\.\d+)?$/, message: "只能输入数值类型" },
                  ]);
                } else {
                  this.$set(this.rules, r.aavName, [
                    {
                      required: true,
                      message: `请输入${r.fieldName}`,
                      trigger: "change",
                    },
                  ]);
                }
              } else {
                if (this.rules[r.aavName]) {
                  delete this.rules[r.aavName];
                }
              }
            });
          }
          this.attrs = JSON.parse(JSON.stringify(attrs));
          this.$emit("attrChange", this.attrs);
          this.form = JSON.parse(JSON.stringify(formData));
          // if (this.form.groupId) {
          //   this.reViewArea();
          // }
          // this.props.lazyLoad = this.reViewArea
        }
      });

      // this.loading = true;
      // gameConfigApi.getGameConfig({ gameId: this.form.gameId }).then((res) => {
      //   this.loading = false;
      //   if (res.code == 200) {
      //     let attrs = res.rows;
      //     if (attrs.length) {
      //       attrs.forEach((r) => {
      //         if (r.fieldType == "checkbox") {
      //           this.$set(this.form, r.aavName + "rander", []);

      //         }else if (r.fieldType == "boxradio") {
      //             r.childAttributes.forEach((first) => {
      //               first.ischeck = false;
      //             });
      //           } else {
      //           this.$set(this.form, r.aavName, "");
      //         }
      //         this.resetRules()
      //         if (r.isEnable == "0" && r.must == "true") {
      //           if (r.fieldType == "checkbox") {
      //             this.rules[r.aavName + "rander"] = [
      //               {
      //                 required: true,
      //                 message: `请选择${r.fieldName}`,
      //                 trigger: "change",
      //               },
      //             ];
      //           } else {
      //             this.$set(this.rules, r.aavName, [
      //               {
      //                 required: true,
      //                 message: `请输入${r.fieldName}`,
      //                 trigger: "change",
      //               },
      //             ]);
      //           }
      //         } else {
      //           if (this.rules[r.aavName]) {
      //             delete this.rules[r.aavName];
      //           }
      //         }
      //       });
      //     }

      //     this.attrs = JSON.parse(JSON.stringify(attrs));
      //     this.form
      //     ////console.log("%c Line:1489 🍡 this.form", "color:#4fff4B", this.form);
      //     // this.$nextTick(()=>{
      //     //   this.$refs["form" + this.activedIndex][0].resetFields()
      //     // })
      //   }
      // });
    },
    // 根据贵族积分获取贵族等级
    // 数值型改变
    numChange(e, aavName) {
      if (this.form.gameId == 2 && aavName == "f4") {
        if (e >= 10 && e < 100) {
          // v1
          this.form.f2 = 41699;
        } else if (e >= 100 && e < 500) {
          // v2
          this.form.f2 = 41700;
        } else if (e >= 500 && e < 2000) {
          // v3
          this.form.f2 = 41701;
        } else if (e >= 2000 && e < 5000) {
          // v4
          this.form.f2 = 41702;
        } else if (e >= 5000 && e < 10000) {
          // v5
          this.form.f2 = 41703;
        } else if (e >= 10000 && e < 20000) {
          // v6
          this.form.f2 = 41704;
        } else if (e >= 20000 && e < 50000) {
          // v7
          this.form.f2 = 41705;
        } else if (e >= 50000 && e < 100000) {
          // v8
          this.form.f2 = 41706;
        } else if (e >= 100000 && e < 188888) {
          // v9
          this.form.f2 = 41707;
        } else if (e >= 188888) {
          // v10
          this.form.f2 = 41708;
        } else {
          this.form.f2 = "";
        }
      }
    },
    // 单选项改变
    radioChange(e, aavName, list) {
      if (e) {
        list.forEach((r) => {
          if (r.id == e) {
            this.form[aavName + "name"] = r.fieldName;
            return;
          }
        });
      } else {
        this.form[aavName + "name"] = "";
      }
    },
    // 多选项改变
    checkboxChange(e, key) {
      if (e && e.length) {
        this.form[key] = e.join(",");
      } else {
        this.form[key] = "";
      }
      this.desAutoset();
    },
    // 点击多选框单选的多选框点击事件
    boxradioCheckClick(e, custom, checkItem, i) {
      if (this.boxradioIsShow == checkItem.id) {
        this.boxradioIsShow = "";
      } else {
        this.boxradioIsShow = checkItem.id;
      }
      checkItem.ischeck = false;
      checkItem.fieldName = checkItem.fieldName.split("(")[0];
      this.setValue(custom);
    },
    // 点击多选单选框中的单选框事件
    boxradioChange(e, checkItem, custom, i) {
      this.$nextTick(() => {
        this.boxradioIsShow = "";
        checkItem.ischeck = true;
        checkItem.childAttributes.forEach((r) => {
          if (r.id == this.form[custom.aavName + i]) {
            checkItem.fieldName =
              checkItem.fieldName.split("(")[0] + "(" + r.fieldName + ")";
          }
        });
        this.setValue(custom);
      });
    },
    // 原神多选框赋值
    setValue(custom) {
      // 赋值
      let arr = [];
      custom.childAttributes.forEach((item, ind) => {
        if (item.ischeck) {
          // 多选框选中 取子级单选选中的id
          arr.push(this.form[custom.aavName + ind]);
        }
      });
      if (arr.length) {
        this.form[custom.aavName] = arr.join(",");
      } else {
        this.form[custom.aavName] = "";
      }
      ////console.log("this.form[custom.aavName]", this.form[custom.aavName]);
      this.$forceUpdate();
    },
    // 重置
    reset() {
      // this.$refs["form" + this.activedIndex][0].resetFields()
      // ////console.log("%c Line:1161 🥓 this.$refs[this.activedIndex]", "color:#f5ce50", this.$refs);
      this.selectedPhone = "";
      this.form = {};
      this.imgFileList = [];
      this.imgShowList = [];
      this.titleImgList = [];
      this.videoList = [];
      this.newImages = [];
      this.attrs = [];
    },

    // 是否特价
    // changeSpecial() {
    //   if (1 == this.form.accType) {
    //     this.ifSpecial = false;
    //   } else {
    //     this.form.specialPrice = null;
    //   }
    // },
    // 游戏类型改变 初始化
    selectDialogGameType() {
      this.getAttrList();
    },
    cleanRemoveAllParentheses(str) {
      // 去除所有圆括号及其内容
      let result = str.replace(/\([^\)]*\)|（[^）]*）/g, "");
      // 将多个连续空格替换为单个空格
      return result.replace(/\s+/g, "").trim();
    },
    // 根据属性生成简介
    shengcheng(){
      this.$confirm("该操作将会按照您填写的游戏属性信息生成商品描述和标题，确定继续吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 处理简介
          let str = "";
          let desbefore = ''
          // 区服
          if(this.form.gameType==0){
            desbefore = `${this.form.systemName||''}${this.form.carrierName||''}，`
          }else{
            desbefore = `${this.form.groupName||''}${this.form.serverName||''}，`
          }
          
          this.attrs.forEach((item, i1) => {
            // 单选或输入或数值
            if (
              item.fieldType == "radio" &&
              item.isEnable == "0" &&
              item.childAttributes
            ){
              let txt = ''
              item.childAttributes.forEach((t2, i2) => {
                // 处理被勾选的
                if (this.form[item.aavName]==t2.id) {
                  txt = t2.fieldName;
                }
              });
              if(txt) desbefore = desbefore + `${item.fieldName}:${txt}，`
            }
            if (
              (item.fieldType == "input"||item.fieldType == "number") &&
              item.isEnable == "0"&&this.form[item.aavName]&&this.form[item.aavName]!="0"
            ){
              desbefore = desbefore + `${item.fieldName}:${this.form[item.aavName]}，`
            }
            // 多选
            if (
              item.fieldType == "checkbox" &&
              item.isEnable == "0" &&
              item.childAttributes
            ) {
              let subStr = "";
              item.childAttributes.forEach((t2, i2) => {
                // 处理被勾选的
                if (this.form[item.aavName + "rander"].indexOf(t2.id) > -1) {
                  subStr = `${subStr}${t2.fieldName}，`;
                }
              });
            
              if (subStr) {
                str = `${str}【${item.fieldName}】${subStr}\n`;
              }
            }
          });
          this.form.des = desbefore +'\n' + str;
          // 设置标题
          this.$emit(
            "setTitle",
            this.form.des
          );
        })
        .catch(() => {});
    },
    // 根据简介自动识别多选项
    zidongChange() {
      let arr = [];
      if (this.form.des) {
        let desStr = this.form.des;
        desStr = desStr.replace(/，/g, ",");
        desStr = desStr.replace(/\//g, ",");
        desStr = desStr.replace(/】/g, ",");
        desStr = desStr.replace(/：/g, ",");
        desStr = desStr.replace(/\r?\n|\r/g, ",");
        if (this.form.gameId == 3) {
          // 和平
          desStr = desStr.replace(/\s+/g, ",");
        }
        if (this.form.gameId == 10) {
          // 火影  去除字段后括号中的内容
          desStr = this.cleanRemoveAllParentheses(desStr);
          // 取出 S忍数量 A忍数量
          const snum = desStr.match(/(\d+)S级忍者数/);
          const anum = desStr.match(/(\d+)A级忍者数/);
          this.form.f1 = snum ? snum[1] : this.form.f1;
          this.form.f2 = anum ? anum[1] : this.form.f2;
        }
        arr = desStr.split(",");
      }
      // 回显勾选
      this.attrs.forEach((item) => {
        // if (this.form[item.aavName]) {
        if (item.fieldType == "checkbox" && item.childAttributes) {
          item.childAttributes.forEach((t2) => {
            arr.forEach((t3) => {
              let t4 = t3 ? t3.trim() : "";
              if (t4 && t2.fieldName == t4) {
                if (this.form[item.aavName + "rander"].indexOf(t2.id) == -1) {
                  this.form[item.aavName + "rander"].push(t2.id);
                }
              }
            });
          });
          this.form[item.aavName] =
            this.form[item.aavName + "rander"].join(",");
          this.$forceUpdate();
        } else if (item.fieldType == "boxradio" && item.childAttributes) {
          item.childAttributes.forEach((t2, t2Ind) => {
            if(t2.childAttributes&&t2.childAttributes.length){
              t2.childAttributes.forEach((t4) => {
                arr.forEach((t3) => {
                  // t2.fieldName.indexOf(t3) > -1
                  // t4.fieldName == t3
                  if (t3 && t4.fieldName == t3 && !t2.ischeck) {
                    console.log("%c Line:3635 🌽 t3", "color:#3f7cff", t3);
                    this.form[item.aavName + t2Ind] = t4.id;
                    t2.ischeck = true;
                    if (this.form[item.aavName].indexOf(t4.id) == -1) {
                      t2.fieldName = t2.fieldName.split("(")[0];
                      t2.fieldName = t2.fieldName + "(" + t4.fieldName + ")";
                    }
                  }
                });
              });
            }
            
          });
          this.setValue(item);
        }
        // }
      });
    },
    /** 一键生成主图 */
    async makeTitleImg() {
      // 处理多选项，拼接duoxuan详情的LIST
      let list = [];
      let img = "";
      let str = "";
      this.attrs.forEach((t) => {
        if (t.fieldType == "checkbox" || t.fieldType == "boxradio") {
          if (this.form[t.aavName]) {
            str = str + this.form[t.aavName] + ",";
          }
        }
      });
      // let res = await infoApi.getSelectList({
      //   ids: str
      // })
      // list = res.data
      // 生成
      let obj = JSON.parse(JSON.stringify(this.form));
      let list2 = JSON.parse(JSON.stringify(this.attrs));
      img = await makeImgsV3.makeTitleImgStart(obj, str, list2);
      return img;
    },
    /** 一键生成详情图 */
    async makeDetailImgs() {
      // 处理多选项，拼接duoxuan详情的LIST
      let list = [];
      let img = "";
      let str = "";
      this.attrs.forEach((t) => {
        if (t.fieldType == "checkbox") {
          if (this.form[t.aavName] && t.childAttributes) {
            for (let j = 0; j < t.childAttributes.length; j++) {
              let k = t.childAttributes[j];
              if (this.form[t.aavName].includes(k.id)) {
                list.push(k);
              }
            }
          }
        } else if (t.fieldType == "boxradio") {
          if (this.form[t.aavName] && t.childAttributes) {
            for (let j = 0; j < t.childAttributes.length; j++) {
              let k = t.childAttributes[j];
              if (k.childAttributes) {
                for (let l = 0; l < t.childAttributes.length; l++) {
                  let c = t.childAttributes[l];
                  if (this.form[t.aavName].includes(c.id)) {
                    list.push(c);
                  }
                }
              }
            }
          }
        }
      });
      // let res = await infoApi.getSelectList({
      //   ids: str
      // })
      // list = res.data
      // 生成
      img = await makeImgsV3.makeDetailImg(list);
      return img;
    },
    // 一键获取首图
    async openGetInfoDialog() {
      this.makeTitleImgBtnLoading = true;
      let img = "";
      try {
        img = await this.makeTitleImg();
        this.makeTitleImgBtnLoading = false;
      } catch {
        this.makeTitleImgBtnLoading = false;
      }
      // 显示图片
      this.form.titleImg = img;
    },
    // 一键获取详情图
    async getDetailImgs() {
      this.makeDetailImgBtnLoading = true;
      let img = "";
      try {
        img = await this.makeDetailImgs();
        this.makeDetailImgBtnLoading = false;
      } catch {
        this.makeDetailImgBtnLoading = false;
      }
      // 显示图片
      this.form.detailImg = img;
    },
    // 图片转换
    base64ToBlob(code) {
      let parts = code.split(";base64,");
      let contentType = parts[0].split(":")[1];
      let raw = window.atob(parts[1]);
      let rawLength = raw.length;
      let uInt8Array = new Uint8Array(rawLength);

      for (let i = 0; i < rawLength; ++i) {
        uInt8Array[i] = raw.charCodeAt(i);
      }
      return new Blob([uInt8Array], { type: contentType });
    },

    // handleSelectionChange(val) {
    //   this.checkSuperList = val;
    // },
    // 提交
    submitForm() {
      this.$refs["formRel"].validate((valid) => {
        if (valid) {
          const Temp = { ...this.form };
          // groupId: "",
          // serverId: "",
          // systemId: "",
          // carrierId: "",
          delete Temp.groupId;
          delete Temp.serverId;
          delete Temp.systemId;
          delete Temp.carrierId;
          delete Temp.groupName;
          delete Temp.serverName;
          delete Temp.systemName;
          delete Temp.carrierName;
          this.$emit("submit", Temp);
          return true;
        } else {
          // this.$alert("请将详细信息填写完整！");
          return false;
        }
      });
    },
    close() {
      this.btnLoading = false;
      this.makeTitleImgBtnLoading = false;
      this.makeDetailImgBtnLoading = false;
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    goLinkto() {
      this.$router.push({
        path: "/jifenshangcheng",
      });
    }
  },
};
</script>
<style scoped lang="scss">
.release-tool-page {
  background-color: #fff;
  padding: 15px;
  // .step1,
  // .step2 {
  //   // padding: 20px;
  //   // background-color: $fff;
  //   // margin-top: 16px;
  //   // padding-bottom: 15px;
  // }
  // .step2{
  //   padding: 20px;
  //   background-color: $fff;
  // }
  .step1 {
    margin-top: 16px;
  }
}

.center {
  text-align: center;
  width: 100%;
  padding: 10px 0;
}
.boxradioitem {
  padding: 15px;
  border: 1px dashed #999;
  border-radius: 10px;
}

.el-radio {
  display: block;
  line-height: 22px;
}

.boxradioRadioBox {
  background: #fff;
  box-shadow: 0 0 7px #e3e3e3;
  padding: 10px;
  position: absolute;
  z-index: 99;
  left: 20px;
  top: 30px;
  display: none;
}

.boxradioRadioBox.show {
  display: block;
}
// .form-box .el-checkbox {
//   width: 200px;
//   margin: 0;
// }
::v-deep .form-box .el-checkbox__label {
  text-overflow: ellipsis;
  width: 180px;
  overflow: hidden;
  vertical-align: middle;
}
::v-deep .el-form-item--medium .el-form-item__content {
  line-height: 22px;
}

// .input-btn{
//   padding: 7px 0;
// }

.get_by_yingdi_btn {
  margin-right: 10px;
  &.saoma {
    margin-bottom: 10px;
  }
}
</style>
